Lua scripts


What is lua and how to start?



Lua is powerful interface to call registry functions using user lua custom scripts.
Documentation with all registred functions you can find in Rifbot folder inside file called Rifbot Lib.lua
Check up for already created scripts and start with something basic like a healing.



How to add script?



1. Go to MyDocuments\Rifbot\Scripts\.. 
2. Create a Notepad file and paste code. 
3. Set name: Script.lua, type: All Files and save.



There are some examples?



There are many examples with explanation how it works. Visit my github and try to learn something!
* I don't have time to create new one.


bring me to lua examples


115 comments:

  1. hi, how to make logout when player on screen or move character to house (when i stay in entrance house) when player on screen?

    ReplyDelete
    Replies
    1. Hello!

      This is already done using Rifbot pannel functions inside Runemaker section.
      You can also checkup for Options-> Lua script -> Player Logout.lua

      Delete
    2. ok, thanks i didnt see this before :P
      could you make script in free time for making runes?
      when player dont have blank then he go few SQM to house for blanks and go back to place where he made runes xd

      Delete
    3. and 1 more needed, when player on screen then bot get stop. when player leave screen then bot is run again

      Delete
    4. Pause bot on player added to above list.

      Delete
  2. Hello,
    Rafal do You have any suggestions about player log out when player is about 2-3 sqm above the screen (he can;t see us?)
    I saw some bots got this, and he log out even I dont see him on screen.
    It would be very helpful :)

    Thank you for your job and looking for your forward

    ReplyDelete
    Replies
    1. Hello!

      Battle list is structure that store players with range:

      for x = {-8, 9}
      for y = {-6, 7}

      Your position in tibia is {x = 0, y = 0} then you can detect players..

      1 square away form screen for left side.
      2 squares away from screen for right side.
      1 square away from screen for north side.
      2 squares away from screen for south side

      Delete
  3. Hello. I'd love to know, is it possible to make a script that would attack a monster with a rune (id)?
    Thanks

    ReplyDelete
    Replies
    1. All scripts are now on Github, click link in main post and search for: Kill Monsters.lua

      Delete
  4. Hello. Does the rifbot put blank runes on hand to make them?
    Does the rune maker work in nostalrius?
    Thanks

    ReplyDelete
    Replies
    1. Runemaker was tested on all servers and works fine.
      Putting runes to hand work on Nostalrius.

      You can always check it for yourself using trial.
      If you need trail send me an email.

      Delete
  5. Thanks for all those scripts on Gifthub.

    Is there any possibility for you, in your free time, to do a script that would open 3..4. backpacks at relogin? Or when the runes in the acutal backpack thati s opened are used (so empty bp), it would go to the next one?
    Thanks.

    ReplyDelete
    Replies
    1. And one problem i'm occuring is that whenever my character logs out and logs in (happens like 30% of logouts=> relogin) it opens the backpack then closes it directly.. Any idea how to solve it?
      Thanks.

      Delete
    2. Here you go!

      Added reconnect for backpack on Github: https://github.com/Ascerr/Lua-Scripts/blob/master/Reconnect%20Backpacks.lua

      In next update I'll increase delay for reopen backpack.

      Delete
  6. hi sir, i need scrip for use logout when i look players on floor -1

    ReplyDelete
    Replies
    1. Hello!
      It's already done a month ago, just change config
      https://github.com/Ascerr/Lua-Scripts/blob/master/Multifloor%20Player%20Logout.lua

      Delete
  7. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. Use English, then more people will understand it.
      Put flower under monk default and do not touch character that summon this monster.

      Delete
  8. Witam jest mozliwosc stworzenia skryptu na alarm gdy gracz ma mniej niz X capa?

    ReplyDelete
    Replies
    1. Use English, then more people will understand it.
      Added your script to my GitHub, search for Capity Alert.lua

      Delete
  9. Hello!
    Love your product sir! Thanks a lot for saving my time.
    I got a question. Do you know maybe how to make script which is sending message to me from other character with information about players on the screen? I mean names. Its useful when u're hunted.

    ReplyDelete
    Replies
    1. Thanks!
      https://github.com/Ascerr/Lua-Scripts/blob/master/PM%20With%20Players%20On%20Screen.lua

      Delete
  10. Hello its something weird with The bot now. I cant use uhs on realesta and few ppl cant use mf

    ReplyDelete
    Replies
    1. Open Rifbot using administrator, if not help add this rights to your windows account in control panel

      Delete
  11. Hello!
    Can You make something like logout when x player is offline ?
    Thanks

    ReplyDelete
    Replies
    1. Check this:
      https://github.com/Ascerr/Lua-Scripts/blob/master/VIP%20control.lua

      Delete
  12. Hey
    I am trying to use LUA script "EAT FROM GROUND" from github.
    Unfortunately it is not working.
    It seems to be bugged. Im getting error:
    LUA error: EAT FROM GROUND.LUA line 7: unexpected symbol near "<"

    Can you help me? I would love a script that eats from ground (house door)

    ReplyDelete
    Replies
    1. Hey!
      Code is fine, you must wrong copied or make changes.
      Error show line: 7 then compare your code with code on Github

      Delete
  13. Hello,
    First of all i must say: Well done with this bot!

    I wonder if you can make a script that log out the char for "X" minutes in a "X" period of time.

    Example: Log out during 5 minute every Random hours (randomize the time: 1 time at 18:00 other at 20:23.... and so on)
    That would be a good idea so people cant be sure that we are runemaking becouse of the "Last Login" in the websites.

    ReplyDelete
    Replies
    1. Thanks dude!

      I create script for you, before execute turn off PlayerLogout and Relogin from Rifbot panel functions this is already inside lua script.

      https://github.com/Ascerr/Lua-Scripts/blob/master/Random%20Logout.lua

      Delete
    2. Thank you very much Ascer, you are doing a really good job!

      Delete
  14. Rafal,

    Last time I noticed so many crashes...
    I think its because of logout when player is on screen, now i use multifloor logout.
    https://tinypic.pl/7swqxqk265xq


    Do You have any suggestions, what to do ?

    ReplyDelete
    Replies
    1. Soon comming update to version 1.44 with many changes.
      I could pass you a beta version just send me email.

      Delete
  15. Might be worth checking out if u can make slime script instead becasue if u use enable trainer on bot you get deleted because it sends packages to client (also can u you make so it random makes runes between like 95-99 % mana? also spears pick up option after 3-5 spears so it dont look like bot

    ReplyDelete
    Replies
    1. All these scripts are already done! Search for:

      Slime Training.lua
      Small Stone Picker.lua
      Runemaker.lua (to get random mana change MANA_ABOVE to math.random(400, 600) in line 20)

      Delete
  16. can make if player on screen put on energy ring?

    ReplyDelete
    Replies
    1. Added your request here: https://github.com/Ascerr/Lua-Scripts/blob/master/Players%20Detected%20-%20Ering.lua

      Delete
  17. Hi Ascer!
    Can you make something like users lua scripts, it will be possible to share scripts to another users and maybe this will help you with increasing users community and share their releases.
    Have a nice day.

    ReplyDelete
    Replies
    1. Hello!
      I think about it but after some research this is unuseful since per 15 requests there is one script share. It's brutal true about today users community.

      Delete
  18. Riftbot not working? autolt error line 5416 error: Variable used without being declared

    ReplyDelete
  19. I have the same problem Variable used without being declared

    ReplyDelete
  20. Problem fixed download a new version.

    ReplyDelete
  21. how to make it fishing on medivia unlimited and drop on ground if no more cap?

    ReplyDelete
    Replies
    1. First of all you need a instant rod (if even exists besause normal "wooden fishing rod" can be easy retracted to water by fish).

      Next make valid config for script https://github.com/Ascerr/Lua-Scripts/blob/master/Fishing.lua

      After that you can create a module do drop item under yourself when reach x capity.

      Delete
    2. ok thank you, can you help me with a script to drop x fish from bp to ground? i cant find this in lua scripts.

      Delete
    3. I've added to lua scripts on Github: https://github.com/Ascerr/Lua-Scripts/blob/master/Drop%20Fish%20when%20Cap.lua

      Delete
  22. Any Script for mana potions?

    ReplyDelete
    Replies
    1. Hey!
      If you need mana burn or runemaker for mana points checker there is a solution: https://github.com/Ascerr/Lua-Scripts/blob/master/Runemaker.lua

      Delete
  23. where do we paste bugs in future? medivia lighthack crashing the openGL client always when turned on.

    ReplyDelete
    Replies
    1. Hello!
      Bugs post under last changelog in Home section.
      Fixed problem with lighthack, you don't need to download just run Rifbot and check.

      Delete
  24. Hello,
    Is there any way to make a lua script for combo ue? X player says X on chat char uses Y spell.
    X: exevo gran mas vis -> char uses spell Y

    ReplyDelete
    Replies
    1. Default Speak Proxy is not available in Rifbot. You can use Error or Private Message Proxy, McShortkeys if you play on mc or Module script to cast spell when char name or target id have hpperc < x%

      Delete
  25. Hello, First of all thanks for the great work. I wonder if there's a way to create a script to auto convert Gold (100gps) into 1 Plat.

    Thanks

    ReplyDelete
    Replies
    1. Thanks mate!

      Here you go!

      https://github.com/Ascerr/Lua-Scripts/blob/master/Gold%20Changer.lua

      Delete
  26. please make a script bot open next backpack for manafluid drinker exemple i put 30 backpacks into the same backpack one after one and he open it when they are no any manafluid to drink

    ReplyDelete
    Replies
    1. Done!

      Set config for valid backpack and mana fluid id.
      One backpack per backpack and 19 fluids

      https://github.com/Ascerr/Lua-Scripts/blob/master/Open%20Backpack%20for%20MF.lua

      Delete
    2. great job man thanks !! they are any script for drinking manafluids under me? exemple i'm buying 500 mf under me and he drink it because i don't found anything like that for moment

      Delete
  27. Hello,

    Would you be able to create a script to auto exori con/exori hur the target with a X delay? for example exori hur target every 1000ms

    ReplyDelete
    Replies
    1. Here you go!

      https://github.com/Ascerr/Lua-Scripts/blob/master/SpellMax.lua

      Delete
  28. Hello, great bot, can u post here script to make rune when no player on scren, and stop when see some1 on scren, when player go away, then bot make runes agein, also added to this multiflour logout, when bot detect on -1 or +2 us position autologout, and back in 5min :)

    ReplyDelete
    Replies
    1. Hey!

      Thanks for opinion.

      Runemaker - Player Stop.lua --> https://github.com/Ascerr/Lua-Scripts/blob/master/Runemaker%20-%20Player%20Stop.lua

      Multifloor Player Logout.lua --> https://github.com/Ascerr/Lua-Scripts/blob/master/Multifloor%20Player%20Logout.lua

      Delete
  29. Epic bot dude! Congratulations!

    I wonder if you can make a script to auto open bag when looting. the auto looting is amazing but it doesnt open the bag on corpse.

    Thanks!

    ReplyDelete
    Replies
    1. Thanks for great words!

      It's your script, read config to make sure if all is ok.
      https://github.com/Ascerr/Lua-Scripts/blob/master/Cropse%20Bag%20Opener.lua

      Delete
    2. Good job dude, but problem is that it only open if the bag is the first bp and i tried to make the rest as second,third... but it only work when you have only 1 bp opened.

      Delete
  30. I have a question if the bot works on "real tibi"

    ReplyDelete
    Replies
    1. Nope, inside "About" section you can read supported servers: Mastercores, Realesta Rpg + War, Medivia, Nostalrius, Classictibia, Waropolis, Classicus, Kasteria and RealOTS

      Delete
  31. I got sugestion, can u add function when we run bot, then randomize name aplication in Windows System? I think its better to stay safe :)

    ReplyDelete
    Replies
    1. Definetly no!

      I don't support game clients with build-in spyware program like a BattleEye.
      These games grab tons of inforamtion from your pc and should be removed immidetly.

      Delete
    2. I just mean about Medivia, becouse i hear they have automatic detection system :P My rl friend, who use another bot, got ban with that lol XD

      Delete
    3. Medivia detecting system don't works like spyware BattleEye. They read information about Medivia_OGL.exe not about all your Windows process.

      Delete
  32. Hello, i use Multifloor script, with runemaker in bot deafult, how make it, when we have no blank rune, bot logout and no back to game after that? Last question how to set runemaker, when we dont have blank runes, and dont On logout/spell caster, bot try make runes, how to avoid that, just to dont make nothing? Thx for help :)

    ReplyDelete
    Replies
    1. Re1: Use script Multifloor + VIP + No Runes Logout.lua, when you will out of blank runes bot will logout and won't back to game.

      Re2: This out of logic. If you don't have blanks then..
      a) cast spell to increase magic level.
      b) logout to avoid beeing killed by other players.

      Delete
  33. I need script clouse clent game after done runemaking is possible to create that?

    ReplyDelete
    Replies
    1. Done runemaking? I guess you mean out of blank runes.

      https://github.com/Ascerr/Lua-Scripts/blob/master/Close%20Game%20If%20No%20Runes.lua

      Delete
  34. Hello Ascer,

    This script:

    https://github.com/Ascerr/Lua-Scripts/blob/master/Cropse%20Bag%20Opener.lua

    Doesnt work properly, problem is that it only open if the bag is the first bp and i tried to make the rest as second,third... but it only work when you have only 1 bp opened.

    Could you fix it?

    Thanks

    ReplyDelete
  35. great job man thanks !! they are any script for drinking manafluids under me? exemple i'm buying 500 mf under me and he drink it because i don't found anything like that for moment

    ReplyDelete
    Replies
    1. Hey,

      Thanks for great words!

      It's not possible to dring mana fluids directly from ground.
      You can just pickup fluids under you to backpack and next set in Rifbot pannel auto drinking above X mana percent.

      https://github.com/Ascerr/Lua-Scripts/blob/master/Pickup%20MF%20under%20you.lua

      Delete
  36. Hello! Good job on the bot and also on the help of making scripts possible.

    I have 2 questions and if it's possible to make 2 different scripts.

    I would like to know if it's possible to add automatically assassin stars to the left/right hand when less than X.

    I also would like to use the "STEP" function but i would like to use it like a "dash" in the numpad 4,8,6,2 (Left,North,Right,South)

    Thanks dude,

    Keep up the good work.

    ReplyDelete
    Replies
    1. Hey,

      Re1: I changed Refill Ammo.lua to works also with both hands and arrow slot.
      https://github.com/Ascerr/Lua-Scripts/blob/master/Refil Ammo.lua

      Re2: It's not possible because time between shortkeys is equal to 100ms.

      Delete
  37. Hello Ascer,

    Is there a way to use Keyboard (F1-2-3-4...etc) instead of healing or exori con mobs? becouse there are many times that the bot instead of saying exura vita or exori con or exura gran it says random words..

    Thanks

    ReplyDelete
    Replies
    1. Hello,

      Here you go!

      https://github.com/Ascerr/Lua-Scripts/blob/master/Healing%20-%20Key%20simulate.lua

      Delete
  38. Hello Ascer,

    I wonder if you can create a script for when 0 Soul stop doing runes (example: adori gran flam )but keep doing Exura vita (for example)

    ReplyDelete
    Replies
    1. Hey,

      I make an error proxy checker to cast spell when "soul points" appear inside message. Make sure that this keyword is valid.

      https://github.com/Ascerr/Lua-Scripts/blob/master/No%20Soul%20Cast%20Spell.lua

      Delete
  39. Hello, is possible make script when we login, auto use/open box near us position?

    ReplyDelete
    Replies
    1. Hello,

      It's just want you want. Opening ground container after relogin to game.
      Container will open as first index what is bug already and will be solved in next update.

      https://github.com/Ascerr/Lua-Scripts/blob/master/Open%20Ground%20Container.lua

      Delete
    2. Works perfect, thank you! :)

      Delete
  40. hallo do you have srcipt to follow someone , but with keeping a few distance frames?

    ReplyDelete
    Replies
    1. Sorry, this is not possible in Rifbot.

      Delete
  41. zaraz nie wytrzymam... powiedz prosze jak to działa, że gdy spada mi życie to zamiast mnie uhać to odnawia mane , robi exhaust na manapocie , i życie sobie spada i spadam aż wkonuc padam po raz drugi ponieważ bot preferuje mane od życia

    ReplyDelete
    Replies
    1. Use english next time to help more players.

      If you using checkbox UH and MF in this same time, bot first will restore your mana then restore your health.

      How to solve it?

      Set lower percent for MF and higher for UH

      Delete
  42. Hello playing darkot, how do i add so i heal with great mana potions/ultimate mana potions.

    ReplyDelete
    Replies
    1. Hello,

      If you want it manually just use shortkey: MEUSE id

      For automatic usage change id in this script to restore your mana.

      https://github.com/Ascerr/Lua-Scripts/blob/master/Auto%20Potion.lua

      Delete
    2. Ye i know, but how do i get the id of items? Can i use the bot to see id's.

      Delete
    3. Default in Rifbot is checked function LookItemID inside Tools section. Then look on item in game (left + right mouse click). Later check message inside InformationBox (down of Rifbot pannel).

      When it doesn't work then use lua script to read item id from your arrow slot.
      https://github.com/Ascerr/Lua-Scripts/blob/master/Check%20Id.lua

      Delete
  43. can u tell me how to put waypoints in bot? or some example in lua? thx

    ReplyDelete
    Replies
    1. This is not possible and never will be since cavebot destroy server.

      Delete
  44. can u tell what script bot is using when "HoldPos"? thx

    ReplyDelete
    Replies
    1. Rifbot: HoldPos use function Self.Step to reach ground square. You can check how it works example here: https://github.com/Ascerr/Lua-Scripts/blob/master/Step%20Back%20on%20DMG%20taken.lua

      Delete
  45. Hello, please update bot to new Medivia Client ;)

    ReplyDelete
    Replies
    1. Update was is ready, download manually.

      Delete
  46. Having issues with Nostalrius client -
    "Riftbot is outdated for Endless_OpenGL.exe!
    Make sure you use the last version of RiftBot, Game client and you open bot as administrator."

    What to do?

    ReplyDelete
    Replies
    1. Rifbot support Endless server until 24th of May, leter i just change addresses for new server Fearless 8.0.

      1. Download the last game client from Nostarlius website
      2. Run Rifbot as administrator.

      Delete
  47. Replies
    1. Updated, just inject Rifbot for new client.

      Delete
  48. Hello, can u post script alarm when some1 write to us in default chanel?

    ReplyDelete
  49. Please add support for old-ultra.net it's a server that uses tibianic (cracked) client encrypted with xor key on their server i got the server side source codes if you need to check it out

    ReplyDelete
  50. Good morning, friend Ascerr, let me congratulate you, since your automation program is very good, but, on the other hand, I want to ask you a question due to the scripts "Step Back in DMG taken.lua" It does not work correctly for me, I have tried attacking my character from another maker and nothing happens the character stays in place until he dies, and the scripts "PM With Players On Screen.lua" Send the messages constantly every second, I need to send it to me just a couple of times without spamming, if I put false the option of the messages only the message arrives if the player arrives only once but if he alaje and returns he does not send me the message again

    ReplyDelete
  51. friend please contact with me on my mail edmundos1337@gmail.com i want to ask something thank you very much ! :)

    ReplyDelete
  52. is there a chance to create a .lua script to drop fishes from backpack somewhere else than character position?

    ReplyDelete
  53. Hello, I got a question regarding the player step in the "Runemaking section" I have that enabled but it wont step in any direction anyway?
    Player Step (X) [7] - [5]
    Why wont it work? I am standing south-east of my door to my house :S

    ReplyDelete