├── enableBotOnMacro.lua ├── Mouse Macro.lua ├── Force logout.lua ├── Check Id.lua ├── README.txt ├── Low Health Alarm.lua ├── Logout if full mana.lua ├── [on Shortkey] On Off Cavebot.lua ├── Capity Alert.lua ├── SpellMax.lua ├── Auto Invisible.lua ├── Enable attack any monster if stuck.lua ├── Fast SSA.lua ├── Turn off Skill Trainer on Level.lua ├── Alert on Soul.lua ├── Auto SSA.lua ├── Fast SSA & Might Ring.lua ├── Shovel Dig Around.lua ├── Alarm on Rarity Orange Message.lua ├── Off on fishing if cap.lua ├── [on Shortkey] Switch Weapon In Slot.lua ├── Auto Exori Hur.lua ├── Enemy on Screen Alert.lua ├── Auto Potion.lua ├── Open Ground Container.lua ├── Enable Cavebot if no Blanks.lua ├── [on Shortkey] switch arrow in slot.lua ├── Cut Cube.lua ├── Say word once after login.lua ├── Auto Ring.lua ├── Pause Bot on High Dmg.lua ├── Invasion Raid Message Alert.lua ├── [on Shortkey] Cut grass.lua ├── Logout every time.lua ├── Kill Monsters.lua ├── Drop Items.lua ├── Open Backpack for MF.lua ├── Creature Attack.lua ├── No Soul Cast Spell.lua ├── Charge Empty Scroll.lua ├── Auto Manarune.lua ├── Do something if Stand time.lua ├── Alert on friends low health.lua ├── [on Shortkey] switch ring in slot.lua ├── Dequip rune to container.lua ├── Re-active looter if looting too long.lua ├── Alert on loot message.lua ├── Switch Torch.lua ├── Use Training Wand with Dummy after login.lua ├── Cast Spell When Friend cast too.lua ├── Switch Ering Death Ring.lua ├── Mana Burn Uh.lua ├── Switch Might Ring Other Ring if Mana.lua ├── Place Scarab Coin on Spot.lua ├── Rune on Hotkey.lua ├── Anti Push.lua ├── Create training mob when not found.lua ├── Play Sound if no Blanks.lua ├── Check Creature Type.lua ├── Stop Bot on Mana.lua ├── SD no delay.lua ├── Pause Cavebot if Self Skull.lua ├── Switch Ering Time Ring.lua ├── Use Area Rune on you if dmg from stalker.lua ├── Heal Combo UH + Exura Holy.lua ├── Item on Screen Alert.lua ├── Enable Cavebot when low Soul.lua ├── Logout if no blanks in bps.lua ├── Mouse Click Reconnect Nostalrius.lua ├── Player Logout.lua ├── Switch SSA Aol.lua ├── Use Piggy Banks.lua ├── Pickup Spear on Shortkey.lua ├── Cut Grass Around With Machete.lua ├── Stop Bot on Player.lua ├── Mana restore with monster essence.lua ├── Alert When Teleported.lua ├── Switch SSA Aol (Mana).lua ├── Open Trap Under Yourself.lua ├── Pickup MF around you.lua ├── Re-attack Monster.lua ├── Use LootSeller Item on Main Backpack.lua ├── Untrash door.lua ├── Alarm when pushed.lua ├── On off targeting if item count.lua ├── On off Magic Shooter if friend hpperc.lua ├── Pickup Item Under Mouse.lua ├── Spirit runemaker.lua ├── Alert on Default and Private Message.lua ├── Fast UH Healing.lua ├── Shoot Poison Field with Warlock.lua ├── Stop Bot on Health.lua ├── Open Backpack for Blanks.lua ├── Attack only monsters with full hp.lua ├── Ban Spectators on Cast.lua ├── Alert on keyword in game.lua ├── Wear boots if fire under feets.lua ├── Stop Bot on GM.lua ├── Fishing Water Elementals.lua ├── Stop Walker and Logout after Time.lua ├── On Low HP Drop Bp.lua ├── Utito Tempo If Monster.lua ├── Pickup Stones under dummy.lua ├── Cast Purification Spell.lua ├── Heal monster.lua ├── Enable disable cavebot on mana.lua ├── Magic Wall front of target.lua ├── Logout if no mana regen.lua ├── Go label on private message.lua ├── Auto Private Message Respond.lua ├── Fishing Through Window.lua ├── Close Game If No Runes.lua ├── SD Enemies.lua ├── Login to game after time.lua ├── Wear Life Ring if Low Mana.lua ├── Runemaker.lua ├── SSA & Might Ring on Mana.lua ├── Count Strange Mana Regen.lua ├── Use Rope Around.lua ├── Drop Vials.lua ├── Switch SSA.lua ├── Medivia Boost Knight.lua ├── Change Wand if Monster hpperc.lua ├── VIP Logout.lua ├── Discover Creature Chests.lua ├── Drag Item under Your Character.lua ├── Charge Ancient Helmet with Rubby.lua ├── Healing - Key simulate.lua ├── Paladin Custom Healing 8.0.lua ├── [on Shortkey] Switch Two Hand Weapon.lua ├── Read vials from green message.lua ├── Drop Fish when Cap.lua ├── Anti Push if Player.lua ├── Alarm On Mana.lua ├── Drop Fish and Burst Arrow.lua ├── Switch Soft Boots with other.lua ├── Advertising.lua ├── Prioritize Demonic or Ranged Mobs.lua ├── Turn off looter if cap.lua ├── Slime Training.lua ├── Heal with spell if no monsters.lua ├── Move Platinums To Arrow Slot.lua ├── Players Detected - Ering.lua ├── Pseudo looter (old map).lua ├── Switch Royal Spear with Spear.lua ├── Shutdown Pc at time.lua ├── Off targeting for while if first monster.lua ├── Create food.lua ├── Logout and relogin every time.lua ├── Logout for while on default message.lua ├── Wear Life Ring if Low Health.lua ├── Haste If No Monsters.lua ├── Pause Bot on Dmg Health Calc.lua ├── Out of stones - pickup.lua ├── Uh healing + Exori con.lua ├── Use Ground Around You.lua ├── Drink fluids from dead monsters.lua ├── Alert if item count.lua ├── Destroy Furniture.lua ├── Player attack go to label.lua ├── Switch Ering.lua ├── Wait For Spawn.lua ├── Charge Weapon with Crystal.lua ├── Stop cavebot and logout if no mf.lua ├── Open Next Bp when full.lua ├── Convert chests to monsters.lua ├── UH + IH healing + mana rune.lua ├── Eat From Ground.lua ├── Runelast when target lost.lua ├── Auto Mana Shield if no Monsters.lua ├── Player On Screen + Skull Alarm.lua ├── Switch Life Ring and ROH.lua ├── Heal with eating food.lua ├── Runelast if no target.lua ├── Create Enchanted Spears While Hunt.lua ├── Transfer gold after ask for balance.lua ├── Runemaker (blanks to hand).lua ├── Custom Reconnect.lua ├── Drink Big and Small Mana Fluid.lua ├── Dequip Boots of Haste if player.lua ├── Conjure Arrows.lua └── Restore Mana with conditions.lua /enableBotOnMacro.lua: -------------------------------------------------------------------------------- 1 | -- Enable bot when you're under macro test. 2 | -- Rifbot say code on time drop or risk detected. 3 | 4 | Module.New("enableBotOnMacro", function (module) 5 | if Rifbot.isMacroMode() then 6 | setMacroMode(false) 7 | end 8 | module:Delay(200) 9 | end) -------------------------------------------------------------------------------- /Mouse Macro.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Mouse Macro 3 | Description: Click right on rune and use it on your character. 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | 9 | -- right click 10 | Rifbot.MouseClick(1190, 504, 1) 11 | 12 | -- left click 13 | Rifbot.MouseClick(584, 335, 0) 14 | 15 | -------------------------------------------------------------------------------- /Force logout.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Force logout 3 | Description: Logout character when no pz. 4 | Author: Ascer - example 5 | ]] 6 | 7 | Module.New("Force logout", function (mod) 8 | if Self.isConnected() then 9 | if not Self.isInFight() then 10 | Self.Logout() 11 | end 12 | end 13 | mod:Delay(200) 14 | end) -------------------------------------------------------------------------------- /Check Id.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Check Id 3 | Description: Check ItemID inside Arrow Slot 4 | Author: Ascer - example 5 | ]] 6 | 7 | -- DONT'T EDIT BELOW THIS LINE 8 | 9 | 10 | Module.New("Auto Potion", function () 11 | local arrowSlot = Self.Ammo() 12 | printf("Item id inside arrow slot is " .. arrowSlot.id) 13 | end) -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | These are examples of lua scripts. 2 | 3 | ------------------------------------------------ 4 | How to add script using only code? 5 | ------------------------------------------------ 6 | 7 | 1. Open bot and go options -> Lua Scripts 8 | 2. Click button New Script -> paste your code and set name. 9 | 3. Click button Save, script will be visible in Found Scripts list. 10 | 11 | -------------------------------------------------------------------------------- /Low Health Alarm.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Low Health Alarm 3 | Description: Play sound if your health is below 50%. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local HPPERC = 50 8 | local ALARM_NAME = "Low Health.mp3" -- find more in Rifbot Lib.lua 9 | 10 | Module.New("Low Health", function (mod) 11 | if Self.HealthPercent() < HPPERC then 12 | Rifbot.PlaySound(ALARM_NAME) 13 | end 14 | mod:Delay(200, 500) 15 | end) 16 | -------------------------------------------------------------------------------- /Logout if full mana.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Logout if full mana 3 | Description: Logout your character when full mana. 4 | Author: Ascer - example 5 | ]] 6 | 7 | -- DON'T EDIT BELOW 8 | 9 | Module.New("Logout if full mana", function (mod) 10 | if Self.isConnected() then 11 | local mp = Self.Mana() 12 | if mp > 0 and mp == Self.ManaMax() then 13 | Self.Logout() 14 | end 15 | end 16 | mod:Delay(500, 1000) 17 | end) -------------------------------------------------------------------------------- /[on Shortkey] On Off Cavebot.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: [on Shortkey] On Off Cavebot 3 | Description: Enable or disable whole cavebot module, its shortkey usage script type: EXECUTE name 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | -- When cavebot is enabled disable it. 9 | if Cavebot.isEnabled() then 10 | 11 | -- disable 12 | Cavebot.Enabled(false) 13 | 14 | else 15 | 16 | -- enable 17 | Cavebot.Enabled(true) 18 | 19 | end -------------------------------------------------------------------------------- /Capity Alert.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Capity Alert 3 | Description: Play sound if capity will below x value 4 | Author: Ascer - example 5 | ]] 6 | 7 | local CAPITY = 100 -- when cap below this value play sound. 8 | 9 | -- DON'T EDIT BELOW THIS LINE 10 | 11 | Module.New("Capity Alert", function() 12 | if Self.isConnected() and Self.Capity() <= CAPITY then 13 | Rifbot.PlaySound("No Capity.mp3") 14 | end 15 | mod:Delay(500, 1000) 16 | end) 17 | -------------------------------------------------------------------------------- /SpellMax.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: SpellMax 3 | Description: Cast spell with target id. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SPELL = "exori con" 8 | local DELAY = 1000 9 | 10 | -- DON'T EDIT BELOW 11 | 12 | local spellTime = 0 13 | 14 | Module.New("SpellMax", function(mod) 15 | if os.time() - spellTime > DELAY/1000 then 16 | if Self.TargetID() > 0 then 17 | Self.CastSpell(SPELL) 18 | spellTime = os.time() 19 | end 20 | end 21 | end) -------------------------------------------------------------------------------- /Auto Invisible.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Auto Invisible 3 | Description: If no invisible condition then use spell 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SPELL = {name = "utana vid", mana = 350} 8 | 9 | 10 | -- DON'T EDIT BELOW THIS LINE 11 | 12 | Module.New("Auto Invisible", function (mod) 13 | if Self.isConnected() then 14 | if not Self.isInvisible() and Self.Mana() >= SPELL.mana then 15 | Self.Say(SPELL.name) 16 | end 17 | end 18 | mod:Delay(500, 1000) -- delay 19 | end) 20 | -------------------------------------------------------------------------------- /Enable attack any monster if stuck.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Enable attack any monster if stuck 3 | Description: When walker stuck enable attack any monster else disable. 4 | Author: Ascer - example 5 | ]] 6 | 7 | -- DON'T EDIT BELOW 8 | 9 | Module.New("Enable attack any monster if stuck", function() 10 | local enable = false 11 | if Walker.isStuck() then 12 | enable = true 13 | end 14 | Rifbot.setCheckboxState("cavebot", "attack any monster", enable) 15 | end) -------------------------------------------------------------------------------- /Fast SSA.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Fast Auto SSA 3 | Description: Automatically equip Stone Skin Amulet when slot.amulet is empty. (delay 200ms). 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SSA = 3081 -- id of stone skin amulet 8 | 9 | Module.New("Auto SSA", function (mod) -- declare module name and set function mod 10 | if Self.Amulet().id == 0 then -- get currnet amulet.id 11 | Self.EquipItem(SLOT_AMULET, SSA, 1, 1) -- equip stone skin amulet to amulet slot with quantity 1. 12 | end 13 | end) 14 | -------------------------------------------------------------------------------- /Turn off Skill Trainer on Level.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Turn off Skill Trainer on Level 3 | Description: If your character reach level specifc level turn off skill trainer (attack mod) 4 | Author: Ascer - example 5 | ]] 6 | 7 | local LEVEL = 8 -- what level to reach? 8 | 9 | 10 | -- DON'T EDIT BELOW THIS LINE 11 | 12 | Module.New("Turn off Skill Trainer on Level", function () 13 | if Self.isConnected() then 14 | if Self.Level() >= LEVEL then 15 | Rifbot.setCheckboxState("skill trainer", "enabled", false) 16 | end 17 | end 18 | end) 19 | -------------------------------------------------------------------------------- /Alert on Soul.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Alert on Soul 3 | Description: Play sound when low soul points 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SOUL = 50 -- when your soul points will equal or below this amount play sound. 8 | 9 | -- DON'T EDIT BELOW THIS LINE 10 | 11 | Module.New("Alert on Soul", function (mod) 12 | if Self.isConnected() then 13 | if Self.Soul() <= SOUL then 14 | Rifbot.PlaySound("Default.mp3") 15 | printf("Alert: Low soul points") 16 | end 17 | end 18 | mod:Delay(300, 1200) -- set random delay 19 | end) 20 | -------------------------------------------------------------------------------- /Auto SSA.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Auto SSA 3 | Description: Automatically equip Stone Skin Amulet when slot.amulet is empty. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SSA = 3081 -- id of stone skin amulet 8 | 9 | Module.New("Auto SSA", function (mod) -- declare module name and set function mod 10 | if Self.Amulet().id == 0 then -- get currnet amulet.id 11 | Self.EquipItem(SLOT_AMULET, SSA, 1) -- equip stone skin amulet to amulet slot with quantity 1. 12 | end 13 | mod:Delay(700, 1200) -- set module execution delay random 500, 1200 ms 14 | end) 15 | -------------------------------------------------------------------------------- /Fast SSA & Might Ring.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Fast Auto SSA & Might Ring 3 | Description: Spam equipming Stone Skin Amulet (delay 200ms). 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SSA = 3081 -- id of stone skin amulet 8 | local MRING = 3048 -- id of might ring 9 | 10 | Module.New("Fast SSA & Might Ring", function (mod) -- declare module name and set function mod 11 | Self.EquipItem(SLOT_AMULET, SSA, 1, 1) -- equip stone skin amulet to amulet slot with quantity 1. 12 | wait(100) 13 | Self.EquipItem(SLOT_RING, MRING, 1, 1) -- equip might ring 14 | end) 15 | -------------------------------------------------------------------------------- /Shovel Dig Around.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Shovel Dig Around 3 | Description: Use Shovel around your character 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SHOVEL = 3457 8 | 9 | -- DONT'T EDIT BELOW THIS LINE 10 | 11 | Module.New("Shovel Dig Around", function (mod) 12 | 13 | local pos = Self.Position() 14 | local randX = math.random(-1, 1) 15 | local randY = math.random(-1, 1) 16 | 17 | -- use shovel on random position near me. 18 | Self.UseItemWithGround(SHOVEL, pos.x+randX, pos.y+randY, pos.z) 19 | 20 | mod:Delay(1000, 1200) -- set random delay 21 | end) -------------------------------------------------------------------------------- /Alarm on Rarity Orange Message.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Alarm on Rarity Orange Message 3 | 4 | Description: Play sound when after killing monster appear orange message "Rarity" 5 | Author: Ascer - example 6 | ]] 7 | 8 | 9 | -- DON'T EDIT BELOW 10 | 11 | function proxy(messages) 12 | for i, msg in ipairs(messages) do 13 | if msg.message == "Rarity" and msg.mode == 34 then 14 | if msg.speaker == Self.Name() then 15 | Rifbot.PlaySound() 16 | print("Rarity item dropped!") 17 | end 18 | end 19 | 20 | end 21 | end 22 | Proxy.New("proxy") -------------------------------------------------------------------------------- /Off on fishing if cap.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Off on fishing if cap 3 | Description: Turn off fishing when cap below x value else turn on. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local CAPITY = 40 -- when cap below off fishing 8 | 9 | -- DON'T EDIT BELOW THIS LINE 10 | 11 | Module.New("Off on fishing if cap", function() 12 | if Self.isConnected() then 13 | if Self.Capity() >= CAPITY then 14 | Rifbot.setCheckboxState("Tools", "AutoFishing", true) 15 | else 16 | Rifbot.setCheckboxState("Tools", "AutoFishing", false) 17 | end 18 | end 19 | mod:Delay(500, 1000) 20 | end) -------------------------------------------------------------------------------- /[on Shortkey] Switch Weapon In Slot.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: [on Shortkey] Switch Weapon In Slot 3 | Description: Switch weapon in slot, its shortkey usage script type: EXECUTE name 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | local config = { 9 | first = 3300, -- first weapon id 10 | second = 3265 -- second weapon id 11 | } 12 | 13 | local weapon = Self.Weapon() 14 | 15 | if weapon.id == 0 or weapon.id == config.second then 16 | Self.EquipItem(SLOT_WEAPON, config.first, 1, 0) 17 | elseif weapon.id == config.first then 18 | Self.EquipItem(SLOT_WEAPON, config.second, 1, 0) 19 | end -------------------------------------------------------------------------------- /Auto Exori Hur.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Auto Exori Hur 3 | Description: Cast exori hur if target > 0 and hpperc > 50% and mana points > 40 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SPELL = "exori hur" -- spell to cast 8 | local HPPERC = 50 -- don't cast if hp below % 9 | local MANA = 40 -- minimal mana points to cast spell 10 | 11 | Module.New("Auto Exori Hur", function (mod) 12 | local hp = Self.HealthPercent() 13 | local target = Self.TargetID() 14 | if hp > HPPERC and target > 0 and Self.Mana() >= MANA then 15 | Self.CastSpell(SPELL) 16 | end 17 | mod:Delay(300, 500) 18 | end) -------------------------------------------------------------------------------- /Enemy on Screen Alert.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Enemy on Screen Alert 3 | Description: Play sound if enemy defected on screen. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local ENEMY_LIST = {"Enemy1", "Enemy2"} -- add here enemies. Names need to by with Capital letter. 8 | 9 | Module.New("Enemy on Screen Alert", function () 10 | for i, player in pairs(Creature.iPlayers(7)) do 11 | if table.find(ENEMY_LIST, player.name) then 12 | playSound("Player On Screen.mp3") -- for more search in Rifbot Lib.lua -> RIFBOT_SOUNDS = [] 13 | break -- break loop 14 | end 15 | end 16 | end) -------------------------------------------------------------------------------- /Auto Potion.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Auto Potion 3 | Description: Restore your character mana 4 | Author: Ascer - example 5 | ]] 6 | 7 | local RUNE_DELAY = {1000, 1500} -- delay for Pot is default 1000ms we set a little bit higher. 8 | local MANA_BELOW = 50 -- when your mpperc is below o equal this value character will use POTIONID. 9 | local POTIONID = 6374 -- UH id 10 | 11 | -- DONT'T EDIT BELOW THIS LINE 12 | 13 | local mainDelay, mainTime = 0, 0 14 | 15 | Module.New("Auto Potion", function () 16 | if Self.ManaPercent() <= MANA_BELOW then 17 | Self.UseItemWithMe(POTIONID, math.random(RUNE_DELAY[1], RUNE_DELAY[2])) 18 | end 19 | end) -------------------------------------------------------------------------------- /Open Ground Container.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Open Ground Container 3 | Description: Will open ground container after relogin to game as first index. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local CONTAINER = { 8 | id = 2853, -- id of ground container 9 | x = 32093, -- posx 10 | y = 32216, -- posy 11 | z = 7 -- posz 12 | } 13 | 14 | 15 | -- DONT'T EDIT BELOW THIS LINE 16 | 17 | var = true 18 | 19 | Module.New("No Soul Cast Spell", function () 20 | if Self.isConnected() then 21 | if var then 22 | wait(1000, 1700) 23 | Map.UseItem(CONTAINER.x, CONTAINER.y, CONTAINER.z, CONTAINER.id) 24 | var = false 25 | end 26 | else 27 | var = true 28 | end 29 | end) -------------------------------------------------------------------------------- /Enable Cavebot if no Blanks.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Enable Cavebot if no Blanks 3 | Description: When no blank runes found enable cavebot 4 | Author: Ascer - example 5 | ]] 6 | 7 | local BLANK_ID = 2260 -- type here id of balnk rune 8 | 9 | 10 | -- DON'T EDIT BELOW THIS LINE 11 | 12 | Module.New("Enable Cavebot if no Blanks", function (mod) 13 | 14 | -- when connected 15 | if Self.isConnected() then 16 | 17 | -- if no balnks 18 | if Self.ItemCount(BLANK_ID) <= 0 then 19 | 20 | -- when no enabled 21 | if not Walker.isEnabled() then 22 | 23 | Walker.Enabled(true) 24 | 25 | end 26 | 27 | end 28 | 29 | end 30 | 31 | -- delay 32 | mod:Delay(500) 33 | 34 | end) 35 | -------------------------------------------------------------------------------- /[on Shortkey] switch arrow in slot.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: [on Shortkey] switch arrow in slot 3 | Description: Switch arrow depent on current in slot, its shortkey usage script type: EXECUTE name 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | local config = { 9 | arrow = 3447, -- id o basic arrow 10 | hunting_arrow = 1111, -- id of hunting arrow or other 11 | } 12 | 13 | local ammo = Self.Ammo() 14 | 15 | if ammo.id == 0 then 16 | Self.EquipItem(SLOT_AMMO, config.arrow, 1, 200) 17 | elseif ammo.id == config.arrow then 18 | Self.EquipItem(SLOT_AMMO, config.hunting_arrow, 100, 200) 19 | else 20 | Self.EquipItem(SLOT_AMMO, config.arrow, 100, 200) 21 | end 22 | -------------------------------------------------------------------------------- /Cut Cube.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Cut Cube 3 | Description: Use machete or other weapon id with possible table of items ids (different states on pre statue) 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | cube = {7441,7442,7443,7445}, -- cube ids one or many. 9 | machete = 3308 -- machete id need to be inside container 10 | } 11 | 12 | -- loop module 13 | Module.New("Cut Cube", function() 14 | local cube = Container.FindItem(config.cube) 15 | local machete = Container.FindItem(config.machete) 16 | if table.count(cube) > 1 and table.count(machete) then 17 | Container.UseItemWithContainer(machete.index, machete.slot, machete.id, cube.index, cube.slot, cube.id, 1500) 18 | end 19 | end) -------------------------------------------------------------------------------- /Say word once after login.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Say word once after login 3 | Description: When you lost connection character will auto say command 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | command = "train", -- keyword to say after login to game. 9 | delay = 1000 -- how many miliseconds to wait after login to say word (delay 1000ms = 1sec) 10 | } 11 | 12 | -- DON'T EDIT BELOW THIS LINE 13 | local train = false 14 | 15 | Module.New("Say word once after login", function() 16 | if Self.isConnected() then 17 | if train then 18 | train = false 19 | wait(config.delay) 20 | Self.Say(config.command) 21 | end 22 | else 23 | train = true 24 | end 25 | end) -------------------------------------------------------------------------------- /Auto Ring.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Auto Ring 3 | Description: Equip ring when ring_slot is empty e.g. refil life ring to speed up mana regen 4 | Author: Ascer - example 5 | ]] 6 | 7 | local RINGID = 3052 -- life ring (not used) 8 | local MAIN_DELAY = {700, 2000} -- random delay reading loop. You can increase it for personal usage. 9 | 10 | -- DON'T EDIT BELOW THIS LINE 11 | 12 | Module.New("Auto Ring", function (mod) 13 | if Self.isConnected() then -- check for connection to game 14 | local slot = Self.Ring() 15 | if slot.id <= 0 then 16 | Self.EquipItem(SLOT_RING, RINGID, 1) 17 | end 18 | end 19 | mod:Delay(MAIN_DELAY[1], MAIN_DELAY[2]) 20 | end) 21 | -------------------------------------------------------------------------------- /Pause Bot on High Dmg.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Pause Bot on High Dmg 3 | Description: Reading white proxy message about hitpoints loses and pause bot. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local DMG = 500 -- pause bot when lose 500 or more hitpoints 8 | 9 | 10 | -- DON'T EDIT BELOW THIS LINE 11 | 12 | function proxyText(messages) 13 | for i, msg in ipairs(messages) do 14 | local hit = string.match(msg.message, "You lose (.+) hitpoints") 15 | if hit ~= nil then 16 | hit = tonumber(hit) 17 | if hit >= DMG then 18 | Rifbot.setEnabled(false) 19 | Rifbot.PlaySound("Default.mp3") 20 | break 21 | end 22 | end 23 | end 24 | end 25 | Proxy.TextNew("proxyText") -------------------------------------------------------------------------------- /Invasion Raid Message Alert.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Invasion Raid Message Alert 3 | Description: Play Sound when message appear on screen. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local raids = { 8 | "Something strange happen in Thais.", -- messages to check, copy it direct from game client. 9 | "Rat plague in Rookgaard." 10 | } 11 | 12 | -- DON'T EDIT BELOW 13 | 14 | raids = table.lower(raids) 15 | 16 | function proxyText(messages) 17 | for i, msg in ipairs(messages) do 18 | if table.find(raids, string.lower(msg.message)) then 19 | Rifbot.PlaySound() 20 | print(msg.message, msg.mode) 21 | end 22 | end 23 | end 24 | Proxy.TextNew("proxyText") -------------------------------------------------------------------------------- /[on Shortkey] Cut grass.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: [on Shortkey] Cut grass 3 | Description: Cut grass near you, its shortkey usage script type: EXECUTE name 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | local config = { 9 | machete = 3308, -- id of item to cut 10 | grass = {3243, 2344} -- possible grass id 11 | } 12 | 13 | -- load self position 14 | local pos = Self.Position() 15 | 16 | -- load map around our character and use machete if grass found. 17 | for x = -1, 1 do 18 | for y = -1, 1 do 19 | if table.find(config.grass, Map.GetTopMoveItem(pos.x+x, pos.y+y, pos.z).id) then 20 | Self.UseItemWithGround(config.machete, pos.x+x, pos.y+y, pos.z, 0) 21 | break 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /Logout every time.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Logout every time 3 | Description: Take logout action every some time. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local LOGOUT_EVERY = 15 -- minutes every logged you out. 8 | 9 | 10 | -- DONT EDIT BELOW THIS LINE 11 | 12 | local logoutTime = os.time() 13 | 14 | Module.New("Logout every time", function (mod) 15 | 16 | -- when time is ok logout char 17 | if os.time() - logoutTime >= (60 * LOGOUT_EVERY) then 18 | 19 | -- logout. 20 | Self.Logout() 21 | 22 | -- update time 23 | logoutTime = os.time() 24 | 25 | end 26 | 27 | 28 | -- module execution delay in ms. 29 | mod:Delay(500, 1500) 30 | 31 | end) 32 | -------------------------------------------------------------------------------- /Kill Monsters.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Kill monsters. 3 | Description: Kill declared monsters with specific runeid 4 | Author: Ascer - example 5 | ]] 6 | 7 | local TARGET_LIST = {"Cyclops", "Warlock"} -- add here monster names 8 | local RUNEID = 3155 -- rune have to be visible in containers 9 | 10 | -- DONT'T EDIT BELOW THIS LINE 11 | 12 | tbl = table.lower(TARGET_LIST) 13 | 14 | Module.New("Kill monsters", function (mod) 15 | for i, mob in pairs(Creature.iMonsters(7, false)) do 16 | if table.find(tbl, string.lower(mob.name)) then 17 | Self.UseItemWithCreature(mob, RUNEID) -- use rune with creature. 18 | wait(500) 19 | break -- break loop 20 | end 21 | end 22 | end) 23 | -------------------------------------------------------------------------------- /Drop Items.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Drop Items 3 | Description: Drop items under your character from any open container 4 | Author: Ascer - example 5 | ]] 6 | 7 | local ITEMS = {3031, 3492} -- items to drop 8 | local DROP_DELAY = {300, 1000} -- time between actions 9 | 10 | -- DON'T EDIT BELOW THIS LINE 11 | 12 | Module.New("Drop Items", function (mod) 13 | local item = Container.FindItem(ITEMS) 14 | if item ~= false then 15 | local pos = Self.Position() 16 | Container.MoveItemToGround(item.index, item.slot, pos.x, pos.y, pos.z, item.id, item.count) -- this function at least parameter set default delay for move items check for more detail in Rifbot Lib.lua 17 | end 18 | mod:Delay(DROP_DELAY[1], DROP_DELAY[2]) 19 | end) 20 | -------------------------------------------------------------------------------- /Open Backpack for MF.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Open Backpack for MF 3 | Description: Open next backpack if no mana fluid found. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local MF_ID = 2874 -- id of mana fluid 8 | local BACKPACK_ID = 2854 -- id of backpack with manafluids 9 | 10 | -- DON'T EDIT BELOW 11 | 12 | Module.New("Open Backpack for MF", function(mod) 13 | local mf = Container.FindItem(MF_ID) 14 | if not mf or (mf and mf.count ~= MANA_FLUID.count) then 15 | local newCont = Container.FindItem(BACKPACK_ID) 16 | if table.count(newCont) > 1 then 17 | Container.UseItem(newCont.index, newCont.slot, newCont.id, false) -- open new container in this same index 18 | end 19 | end 20 | mod:Delay(700, 1200) 21 | end) 22 | -------------------------------------------------------------------------------- /Creature Attack.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Creature Attack 3 | Description: Play sound if any monster or player attack you. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SAFE_LIST = {"Defense Monster", "Friend2"} -- add here your training friend or defense monster for example. Names need to by with Capital letter. 8 | 9 | Module.New("Creature Attack", function (mod) 10 | for i, mob in pairs(Creature.getCreatures()) do 11 | if not table.find(SAFE_LIST, mob.name) then 12 | if mob.attack == 1 then 13 | Rifbot.PlaySound("Player Attack.mp3") -- for more search in Rifbot Lib.lua -> RIFBOT_SOUNDS = [] 14 | break -- break loop 15 | end 16 | end 17 | end 18 | mod:Delay(200) 19 | end) -------------------------------------------------------------------------------- /No Soul Cast Spell.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: No Soul Cast Spell 3 | Description: Cast spell when no more soul points. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local MAIN_DELAY = {400, 1700} -- delay in milisecond random actions 8 | local MANA_ABOVE = 160 -- MANA POINTS above this cast spell 9 | local SPELL = "exura vita" -- spell to cast 10 | 11 | 12 | 13 | -- DONT'T EDIT BELOW THIS LINE 14 | 15 | Module.New("No Soul Cast Spell", function (mod) 16 | if Self.Mana() >= MANA_ABOVE then 17 | if string.instr(Proxy.ErrorGetLastMessage(), "soul points") then 18 | Self.CastSpell(SPELL) 19 | Proxy.ErrorClearMessage() -- we need to clear message manually. 20 | end 21 | end 22 | mod:Delay(MAIN_DELAY[1], MAIN_DELAY[2]) -- set random delay 23 | end) -------------------------------------------------------------------------------- /Charge Empty Scroll.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Charge Empty Scroll 3 | Description: Will charge empty scroll with specific item. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | empty_scrolls = {5108, 5112}, -- IDs of empty scrolls can be one or more. Separate it by comma. 9 | charge_item = 5129 -- ID of item to recharge scroll. 10 | } 11 | 12 | -- DON'T EDIT BELOW THIS LINE 13 | 14 | Module.New("Charge Empty Scroll", function (mod) 15 | local scroll = Container.FindItem(config.empty_scrolls) 16 | if table.count(scroll) > 1 then 17 | local charge = Container.FindItem(config.charge_item) 18 | if table.count(charge) > 1 then 19 | Container.UseItemWithContainer(charge.index, charge.slot, charge.id, scroll.index, scroll.slot, scroll.id, 0) 20 | end 21 | end 22 | mod:Delay(1000) 23 | end) 24 | -------------------------------------------------------------------------------- /Auto Manarune.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Auto Manarune 3 | Description: Restore your character mana using manarune 4 | Author: Ascer - example 5 | ]] 6 | 7 | local RUNE_DELAY = {1000, 1200} -- delay for Pot is default 1000ms we set a little bit higher. 8 | local MANA_BELOW = 70 -- when your mpperc is below o equal this value character will use POTIONID. 9 | local SAFE_HEALTH = 50 -- dont restore mana if hpperc is below this value 10 | local POTIONID = 3157 -- manarune id (3157 - weak) 11 | 12 | -- DONT'T EDIT BELOW THIS LINE 13 | 14 | Module.New("Auto Manarune", function () 15 | if Self.ManaPercent() <= MANA_BELOW and Self.HealthPercent() > SAFE_HEALTH then 16 | Self.UseItemWithMe(POTIONID, math.random(RUNE_DELAY[1], RUNE_DELAY[2])) 17 | end 18 | end) -------------------------------------------------------------------------------- /Do something if Stand time.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Do something if Stand time 3 | Description: If stand time is above X do something. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | time = 5 -- how many seconds of stand time to do something. 9 | } 10 | 11 | -- DONT EDIT BELOW THIS LINE 12 | 13 | local standTime, lastPos = 0, {x=0, y=0, z=0} 14 | 15 | Module.New("Do something if Stand time", function() 16 | local pos = Self.Position() 17 | if pos.x ~= lastPos.x or pos.y ~= lastPos.y or pos.z ~= lastPos.z then 18 | standTime = os.clock() 19 | end 20 | lastPos = pos 21 | local diff = os.clock() - standTime 22 | -- do here you stuff diff store how many seconds elapsed from last position. 23 | if diff > config.time then 24 | print("stand time is " .. diff) 25 | end 26 | end) -------------------------------------------------------------------------------- /Alert on friends low health.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Alert on friends low health 3 | Description: When someone from bot friends list have low health it will play sound. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | hpperc = 50 -- when friend hpperc <= 50% then play sound 9 | } 10 | 11 | -- DON'T EDIT BELOW THIS LINE. 12 | local friends = Rifbot.FriendsList(true) 13 | 14 | -- Module working in loop. 15 | Module.New("Alert on friends low health", function () 16 | if Self.isConnected() then 17 | for _, c in ipairs(Creature.iPlayers(7, false)) do 18 | if table.find(friends, string.lower(c.name)) and c.hpperc <= config.hpperc then 19 | Rifbot.PlaySound("Low Health.mp3") 20 | print("Friend: " .. c.name .." low health: " .. c.hpperc .. "%") 21 | break 22 | end 23 | end 24 | end 25 | end) -------------------------------------------------------------------------------- /[on Shortkey] switch ring in slot.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: [on Shortkey] switch ring in slot 3 | Description: Switch ring depent on current in slot, its shortkey usage script type: EXECUTE name 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | local config = { 9 | first = {on = 2344, off = 2342}, -- first ring to switch, on - id when ring inside eq, off - id when ring inside bp. 10 | second = {on = 2314, off = 2322} -- second ring to switch, on - id when ring inside eq, off - id when ring inside bp. 11 | } 12 | 13 | local ring = Self.Ring() 14 | 15 | if ring.id == 0 then 16 | Self.EquipItem(SLOT_RING, config.first.off, 1, 200) 17 | elseif ring.id == config.first.on then 18 | Self.EquipItem(SLOT_RING, config.second.off, 1, 200) 19 | else 20 | Self.EquipItem(SLOT_RING, config.first.off, 1, 200) 21 | end 22 | -------------------------------------------------------------------------------- /Dequip rune to container.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Dequip rune to container 3 | Description: When you create rune, dequip it to specific container index. 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | local config = { 9 | rune = 3031, -- dequip this rune id from left hand. 10 | container_index = 0, -- to container index: 0 - first opened. 11 | } 12 | 13 | -- DON'T EDIT BELOW THIS LINE 14 | 15 | Module.New("Dequip rune to container", function() 16 | if Self.isConnected() then 17 | local weapon = Self.Weapon() 18 | if weapon.id == config.rune then 19 | local cont = Container.getInfo(config.container_index) 20 | local slotTo = 19 21 | if table.count(cont) > 0 then 22 | slotTo = cont.amount 23 | end 24 | Self.DequipItem(SLOT_WEAPON, config.container_index, slotTo, 500) 25 | end 26 | end 27 | end) -------------------------------------------------------------------------------- /Re-active looter if looting too long.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Re-active looter if looting too long 3 | Description: Script will fast disable and enable looter module when you looting more than x miliseonds. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local LOOTING_TIME = 4000 -- how many miliseconds (1000 = 1s) to stop looting (checking if character walking to creature to don't turn off looter in this case) 8 | 9 | -- DONT EDIT BELOW THIS LINE 10 | 11 | local t = 0 12 | 13 | Module.New("Re-active looter if looting too long", function() 14 | if Looter.isLooting() then 15 | if t == 0 then 16 | t = os.clock() 17 | else 18 | if (os.clock() - t)*1000 > LOOTING_TIME and not Self.isWalking() then 19 | Looter.Enabled(false) 20 | Looter.Enabled(true) 21 | t = 0 22 | end 23 | end 24 | else 25 | t = 0 26 | end 27 | end) -------------------------------------------------------------------------------- /Alert on loot message.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Alert on loot message 3 | Description: Play sound when specific text appear in message. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local ITEMS = {"gold", "Dawn Light"} -- type here example items from loot message or other text you want to catch. 8 | 9 | -- DONT'T EDIT BELOW THIS LINE 10 | 11 | ITEMS = table.lower(ITEMS) 12 | 13 | function proxy(messages) 14 | for i, msg in ipairs(messages) do 15 | for j, item in ipairs(ITEMS) do 16 | msg.message = string.lower(msg.message) 17 | if string.find(msg.message, item) then 18 | Rifbot.PlaySound() 19 | print(msg.message, msg.mode) 20 | break 21 | end 22 | end 23 | end 24 | end 25 | Proxy.TextNew("proxy") -------------------------------------------------------------------------------- /Switch Torch.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Switch Torch 3 | Description: Throw to ground burnt down torch, wear brand new torch and light up. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local BURNT_DOWN_TORCH = 2926 -- ID of already used torch without light. 8 | local BRAND_NEW_TORCH = 2920 -- ID of brand new never used torch. 9 | 10 | -- DON'T EDIT BELOW THIS LINE 11 | 12 | Module.New("Switch Torch", function() 13 | if Self.isConnected() then 14 | local ammoSlot = Self.Ammo() 15 | if ammoSlot.id == BURNT_DOWN_TORCH then 16 | local me = Self.Position() 17 | Self.DropItem(me.x, me.y, me.z, BURNT_DOWN_TORCH, 1, 500) 18 | elseif ammoSlot.id == 0 then 19 | Self.EquipItem(SLOT_AMMO, BRAND_NEW_TORCH, 1, 500) 20 | elseif ammoSlot.id == BRAND_NEW_TORCH then 21 | Self.UseItemFromEquipment(SLOT_AMMO, 500) 22 | end 23 | end 24 | end) -------------------------------------------------------------------------------- /Use Training Wand with Dummy after login.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Use Training Wand with Dummy after login 3 | Description: When you lost connection, character will use training wand with dummy (wand must be on ground) 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | wand = {x = 32358, y = 32234, z = 6}, -- training wand position on ground. 9 | dummy = {x = 32359, y = 32235, z = 6} -- position of training dummy 10 | } 11 | 12 | -- DON'T EDIT BELOW THIS LINE 13 | 14 | Module.New("Use Training Wand with Dummy after login", function () 15 | if Self.isConnected() then 16 | if useWand and Container.Amount() > 0 then 17 | wait(1000) 18 | Map.UseItemWithGround(config.wand.x, config.wand.y, config.wand.z, config.dummy.x, config.dummy.y, config.dummy.z, 0) 19 | useWand = false 20 | end 21 | else 22 | useWand = true 23 | end 24 | end) 25 | -------------------------------------------------------------------------------- /Cast Spell When Friend cast too.lua: -------------------------------------------------------------------------------- 1 | 2 | --[[ 3 | Script Name: Cast Spell When Friend cast too. 4 | Description: Cast spell if specific player say keyword on default channel. 5 | Author: Ascer - example 6 | ]] 7 | 8 | local config = { 9 | speaker = "Player Name", 10 | keyword = "exevo gran mas vis", 11 | mana = 600, 12 | spell = "exevo gran mas vis" 13 | } 14 | 15 | -- DONT EDIT BELOW THIS LINE 16 | 17 | function proxy(messages) 18 | for i, msg in ipairs(messages) do 19 | if msg.speaker == config.speaker then 20 | if string.lower(msg.message) == string.lower(config.keyword) then 21 | if Self.Mana() >= config.mana then 22 | Self.Say(config.spell) 23 | end 24 | end 25 | end 26 | end 27 | end 28 | Proxy.New("proxy") 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Switch Ering Death Ring.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Switch Ering Death Ring 3 | Description: Equip energy ring when when hpperc <= 40% else equip death ring. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local ENERGY_RING = {on = 3088, off = 3051} -- set id for ering on - equiped, off - not 8 | local DEATH_RING = 6299 -- ID of ring to switch 9 | local HPPERC = 40 -- when hpperc below or equal rquip ring else dequip 10 | 11 | Module.New("Switch Ering Death Ring", function () 12 | local hp = Self.HealthPercent() 13 | local ring = Self.Ring() 14 | if hp <= HPPERC then 15 | if ring.id ~= ENERGY_RING.on then 16 | Self.EquipItem(SLOT_RING, ENERGY_RING.off, 1) 17 | end 18 | else 19 | if ring.id ~= DEATH_RING then 20 | Self.EquipItem(SLOT_RING, DEATH_RING, 1) 21 | end 22 | end 23 | end) 24 | 25 | -------------------------------------------------------------------------------- /Mana Burn Uh.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Mana Burn 3 | Description: Use spell to burn mana and train magic level. 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | -- LOCAL CONFIG: 9 | 10 | local SPELL = "adura vita" 11 | local RANDOM_MANA_TO_USE_SPELL = {100, 122} 12 | local NO_BLANKS_CAST_SPELL = "exura" 13 | 14 | -- DON'T EDIT BELOW THIS LINE 15 | 16 | local randomMana = 0 17 | 18 | Module.New("Small Stone Picker", function (mod) 19 | if string.instr(Proxy.ErrorGetLastMessage(), "magic item to cast") then 20 | Self.CastSpell(NO_BLANKS_CAST_SPELL) 21 | Proxy.ErrorClearMessage() -- we need to clear message manually. 22 | end 23 | if randomMana <= 0 then 24 | randomMana = math.random(RANDOM_MANA_TO_USE_SPELL[1], RANDOM_MANA_TO_USE_SPELL[2]) 25 | else 26 | if Self.Mana() >= randomMana then 27 | Self.CastSpell(SPELL) 28 | random = 0 29 | end 30 | end 31 | end) -------------------------------------------------------------------------------- /Switch Might Ring Other Ring if Mana.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Switch Might Ring Other Ring if Mana 3 | Description: Equipe might ring when mana below x else wear other ring 4 | Author: Ascer - example 5 | ]] 6 | 7 | local MIGHT_RING = 3048 -- id of might ring 8 | local OTHER_RING = 3010 -- id of ther ring 9 | local MPPERC = 40 -- when mpperc below this value wear might ring else other ring. 10 | 11 | Module.New("Switch Might Ring Other Ring if Mana", function () 12 | local mp = Self.ManaPercent() 13 | local ring = Self.Ring() 14 | if mp <= MPPERC then 15 | if ring.id ~= MIGHT_RING then 16 | Self.EquipItem(SLOT_RING, MIGHT_RING, 1, math.random(200, 300)) 17 | end 18 | else 19 | if ring.id ~= OTHER_RING then 20 | Self.EquipItem(SLOT_RING, OTHER_RING, 1, math.random(200, 300)) 21 | end 22 | end 23 | end) -------------------------------------------------------------------------------- /Place Scarab Coin on Spot.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Place Scarab Coin on Spot 3 | Description: When character reach position x, y, z and there is no scarab coin on spot then it will throw one. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | scarab_coin = {x = 32348, y = 32218, z = 6, id = 3042}, 9 | character_pos = {x = 32348, y = 32219, z = 6} 10 | } 11 | 12 | -- DON'T EDIT BELOW THIS LINE 13 | 14 | Module.New("Place Scarab Coin on Spot", function (mod) 15 | if Self.DistanceFromPosition(config.character_pos.x, config.character_pos.y, config.character_pos.z) == 0 then 16 | if Map.GetTopMoveItem(config.scarab_coin.x, config.scarab_coin.y, config.scarab_coin.z).id ~= config.scarab_coin.id then 17 | Self.DropItem(config.scarab_coin.x, config.scarab_coin.y, config.scarab_coin.z, config.scarab_coin.id, 1, 1000) 18 | print("dropping scarab coin..") 19 | end 20 | end 21 | end) 22 | -------------------------------------------------------------------------------- /Rune on Hotkey.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Rune on Hotkey. 3 | Description: Load script and use rune with hotkey on creature then unload. 4 | Required: Don't execute script in lua, go to Rifbot->Shortkeys and set e.g for key F1 command: execute Rune on Hotkey 5 | Author: Ascer - example 6 | ]] 7 | 8 | local RUNEID = 3198 -- rune have to be visible in containers (default hmm) 9 | local DELAY = 1000 -- time between using rune in miliseconds !Warring this delay may block your healing with runes on pannel. 10 | 11 | -- DONT'T EDIT BELOW THIS LINE 12 | 13 | local tid = Self.TargetID() 14 | 15 | if tid > 0 then 16 | for i, mob in pairs(Creature.iCreatures(7, false)) do 17 | if mob.id == tid then 18 | Self.UseItemWithCreature(mob, RUNEID, DELAY) -- use rune with creature. 19 | break -- break loop 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /Anti Push.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Anti Push 3 | Description: Drop shit under yourself. Required Rifbot v1.31 4 | Author: Ascer - example 5 | ]] 6 | 7 | local DROP_DELAY = {1000, 2000} -- loop reading module 8 | local TRASH = {3031, 3147, 3507} -- trash items, gold, blank rune, label 9 | 10 | -- DONT'T EDIT BELOW THIS LINE 11 | 12 | local dropTime, dropDelay = 0, 0 13 | 14 | Module.New("Anti Push", function () 15 | if os.clock() - dropTime > dropDelay then -- check for delay 16 | local item = Container.FindItem(TRASH) -- search item in container 17 | if item ~= false then 18 | local pos = Self.Position() 19 | Container.MoveItemToGround(item.index, item.slot, pos.x, pos.y, pos.z, item.id, 1) -- move first found item from TRASH list with quantity 1 20 | dropTime = os.clock() 21 | dropDelay = math.random(DROP_DELAY[1], DROP_DELAY[2])/1000 -- set new delay 22 | end 23 | end 24 | end) -------------------------------------------------------------------------------- /Create training mob when not found.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Create training mob when not found. 3 | Description: When monster with selected name not found near your cast spell to create it. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SPELL = "!train" -- spell to cast, to use: "utevo res \"Monk" 8 | local MOB = "Monk" -- name of creature 9 | local RANGE = 5 -- distance on map to check 10 | 11 | -- DON'T EDIT BELOW THIS LINE 12 | 13 | Module.New("Create training mob when not found", function (mod) 14 | if Self.isConnected() then 15 | local found = false 16 | for _, mob in ipairs(Creature.iMonsters(RANGE, false)) do 17 | if string.lower(mob.name) == string.lower(MOB) then 18 | found = true 19 | end 20 | end 21 | if not found then 22 | Self.Say(SPELL) 23 | wait(1000) 24 | end 25 | end 26 | mod:Delay(300, 1200) -- set random delay 27 | end) -------------------------------------------------------------------------------- /Play Sound if no Blanks.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Play Sound if no Blanks 3 | Description: When no more blanks in containers then disable runemaker and logout character. 4 | 5 | Author: Ascer - example 6 | ]] 7 | 8 | local BLANK_RUNE_ID = 2260 -- ID of blank rune. 9 | 10 | 11 | -- DON'T EDIT BELOW THIS LINE 12 | 13 | 14 | 15 | -- Module to run function in loop. 16 | Module.New("Play Sound if no Blanks", function(mod) 17 | 18 | -- when connected. 19 | if Self.isConnected() then 20 | 21 | -- check for blanks in backpacks 22 | if Self.ItemCount(BLANK_RUNE_ID) <= 0 then 23 | 24 | -- check for hands 25 | if Self.Shield().id ~= BLANK_RUNE_ID and Self.Weapon().id ~= BLANK_RUNE_ID then 26 | 27 | -- play sound 28 | Rifbot.PlaySound("Out Of Blanks.mp3") 29 | 30 | end 31 | 32 | end 33 | 34 | end 35 | 36 | -- execute every 1s 37 | mod:Delay(1000) 38 | 39 | end) -------------------------------------------------------------------------------- /Check Creature Type.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Check Creature type 3 | Description: Check is creature is player, monster or NPC and write this in InformationBox 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | local PLAYER = "Player Name" -- name of player with Capital letter 9 | 10 | -- Don't edit below this line. 11 | 12 | Module.New("Check Creature type", function () 13 | if Self.isConnected() then 14 | local players = Creature.iCreatures(7, false) 15 | for i = 1, #players do 16 | local player = players[i] 17 | if player.name == PLAYER then 18 | if Creature.isPlayer(player) then 19 | printf("isPlayer") 20 | elseif Creature.isMonster(player) then 21 | printf("isMonster") 22 | else 23 | printf("isNPC") 24 | end 25 | break 26 | end 27 | end 28 | end 29 | end) 30 | -------------------------------------------------------------------------------- /Stop Bot on Mana.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Stop Bot on Mana 3 | Description: Stop bot when your mana is above and enable when below. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local MANA = 120 -- when mana points below then enable bot else disable 8 | 9 | 10 | -- DONT'T EDIT BELOW THIS LINE 11 | 12 | Module.New("Stop Bot on Mana", function () 13 | 14 | -- when mana is above config 15 | if Self.Mana() >= MANA then 16 | 17 | -- if bot is running. 18 | if Rifbot.isEnabled() then 19 | 20 | -- disable bot 21 | Rifbot.setEnabled(false) 22 | 23 | end 24 | 25 | else 26 | 27 | -- if not is running bot 28 | if not Rifbot.isEnabled() then 29 | 30 | -- enable bot 31 | Rifbot.setEnabled(true) 32 | 33 | end 34 | end 35 | 36 | end) 37 | -------------------------------------------------------------------------------- /SD no delay.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: SD no delay 3 | Description: Execute lua script and shoot sd with target without delay. 4 | Required: Set inside shortkeys command: EXECUTE sd no delay 5 | Author: Ascer - example 6 | ]] 7 | 8 | local RUNE_ID = 2268 -- set rune id here // 3155 new sd id 9 | 10 | -- DON'T edit below. 11 | 12 | -- load target id. 13 | local t = Self.TargetID() 14 | 15 | -- when target is above 0. 16 | if t > 0 then 17 | 18 | -- load creatures 19 | local c = Creature.iCreatures(7, false) 20 | 21 | -- in loop for all players 22 | for i = 1, #c do 23 | 24 | -- load single player 25 | local creature = c[i] 26 | 27 | -- check for id. 28 | if creature.id == t then 29 | 30 | -- shoot sd. 31 | Self.UseItemWithCreature(creature, RUNE_ID, 0) 32 | 33 | end 34 | 35 | end 36 | 37 | end -------------------------------------------------------------------------------- /Pause Cavebot if Self Skull.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Pause Cavebot if Self Skull 3 | Description: Check if self character have skull white, red or black then disable walker and play sound. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local ALERT = true -- true/false play sound if sell skull 8 | 9 | -- DON'T EDIT BELOW THIS LINE 10 | 11 | Module.New("Pause Cavebot if Self Skull", function () 12 | if Self.isConnected() then 13 | local me = Creature.getCreatures(Self.ID()) 14 | if table.count(me) > 1 then 15 | if me.skull >= 3 then 16 | if Walker.isEnabled() then Walker.Enabled(false) end 17 | if Targeting.isEnabled() then Targeting.Enabled(false) end 18 | if Looter.isEnabled() then Looter.Enabled(false) end 19 | if ALERT then Rifbot.PlaySound() end 20 | end 21 | end 22 | end 23 | end) 24 | -------------------------------------------------------------------------------- /Switch Ering Time Ring.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Switch Ering Time Ring 3 | Description: Equip energy ring when when hpperc <= 40% else equip time ring. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local ENERGY_RING = {on = 3088, off = 3051} -- set id for ering on - equiped, off - not 8 | local TIME_RING = {on = 3090, off = 3053} -- set id for time ring on - equiped, off - not 9 | local HPPERC = 40 -- when hpperc below or equal equip e ring else wear time ring. 10 | 11 | Module.New("Switch Ering Time Ring", function () 12 | local hp = Self.HealthPercent() 13 | local ring = Self.Ring() 14 | if hp <= HPPERC then 15 | if ring.id ~= ENERGY_RING.on then 16 | Self.EquipItem(SLOT_RING, ENERGY_RING.off, 1) 17 | end 18 | else 19 | if ring.id ~= TIME_RING.on then 20 | Self.EquipItem(SLOT_RING, TIME_RING.off, 1) 21 | end 22 | end 23 | end) 24 | -------------------------------------------------------------------------------- /Use Area Rune on you if dmg from stalker.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Use Area Rune on you if dmg from stalker. 3 | Description: When Stalker hits you dmg then character auto use rune with yourself. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local MONSTER = "Stalker" 8 | local SHOOT_RUNE = {id = 3161, dontUseIfPlayer = true, delay = 2000} 9 | 10 | -- DON'T EDIT BELOW THIS LINE 11 | 12 | function proxyText(messages) 13 | for i, msg in ipairs(messages) do 14 | if string.instr(msg.message, "You lose") and string.instr(msg.message, MONSTER) then 15 | local player = table.count(Creature.iPlayers(7, false)) 16 | if (not SHOOT_RUNE.dontUseIfPlayer or (SHOOT_RUNE.dontUseIfPlayer and player <= 0)) then 17 | Self.UseItemWithMe(SHOOT_RUNE.id, SHOOT_RUNE.delay) 18 | end 19 | end 20 | end 21 | end 22 | Proxy.TextNew("proxyText") 23 | -------------------------------------------------------------------------------- /Heal Combo UH + Exura Holy.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Heal Combo UH + Exura Holy 3 | Description: When your character hpperc will below x value then in this same time use UH + Spell (its possible on some servers) 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | local config = { 9 | hpperc = 60, -- when hpperc below this value 10 | spell = "exura holy", -- spell to cast 11 | rune = 3160, -- rune id 12 | delay = 2000 -- delay between usages 13 | } 14 | 15 | -- DON'T EDIT BELOW THIS LINE 16 | local castTime = 0 17 | 18 | -- module loop 19 | Module.New("Heal Combo UH + Exura Holy", function () 20 | if Self.isConnected() then 21 | if os.clock() - castTime >= config.delay/1000 then 22 | if Self.HealthPercent() <= config.hpperc then 23 | Self.UseItemWithMe(config.rune, 0) 24 | Self.Say(config.spell) 25 | castTime = os.clock() 26 | end 27 | end 28 | end 29 | end) 30 | -------------------------------------------------------------------------------- /Item on Screen Alert.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Item on Screen Alert 3 | Description: Play sound when item is detected on screen 4 | Author: Ascer - example 5 | ]] 6 | 7 | local ITEMS = {3031, 3492, 3160} -- IDs of items to detect 8 | 9 | 10 | -- DON'T EDIT BELOW 11 | 12 | Module.New("Item on Screen Alert", function () 13 | if Self.isConnected() then 14 | local pos = Self.Position() 15 | for x = -7, 7 do 16 | for y = -5 , 5 do 17 | local map = Map.GetTopMoveItem(pos.x + x, pos.y + y, pos.z) 18 | if table.find(ITEMS, map.id) then 19 | print("Found item id: " .. map.id .. " on pos: " .. pos.x + x .. ", " .. pos.y + y .. ", " .. pos.z) 20 | Rifbot.PlaySound("Default.mp3") 21 | end 22 | end 23 | end 24 | end 25 | mod:Delay(500) 26 | end) -------------------------------------------------------------------------------- /Enable Cavebot when low Soul.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Enable Cavebot when low Soul 3 | Description: Turn on cavebot when low soul points 4 | Author: Ascer - example 5 | ]] 6 | 7 | local ENABLE_TRAINER_WHEN_SOUL = 20 -- when soul points equal or below this value enable cavebot 8 | 9 | 10 | -- DONT EDIT BELOW THIS LINE 11 | 12 | Module.New("Enable Cavebot when low Soul", function (mod) 13 | 14 | -- when self connected. 15 | if Self.isConnected() then 16 | 17 | --load soul points 18 | local soul = Self.Soul() 19 | 20 | -- when soul points are below x enable. 21 | if soul <= ENABLE_TRAINER_WHEN_SOUL then 22 | 23 | if not Walker.isEnabled() then Walker.Enabled(true) end 24 | if not Targeting.isEnabled() then Targeting.Enabled(true) end 25 | if not Looter.isEnabled() then Looter.Enabled(true) end 26 | 27 | end 28 | end 29 | 30 | -- mod delay 31 | mod:Delay(1000, 1500) 32 | 33 | end) 34 | 35 | -------------------------------------------------------------------------------- /Logout if no blanks in bps.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Logout if no balnks in bps 3 | Description: When no more blanks in containers then disable runemaker and logout character. 4 | 5 | Author: Ascer - example 6 | ]] 7 | 8 | local BLANK_RUNE_ID = 2260 -- ID of blank rune. 9 | 10 | 11 | -- DON'T EDIT BELOW THIS LINE 12 | 13 | 14 | 15 | -- Module to run function in loop. 16 | Module.New("Logout if no balnks in bps", function() 17 | 18 | -- when connected. 19 | if Self.isConnected() then 20 | 21 | -- check for blanks in backpacks 22 | if Self.ItemCount(BLANK_RUNE_ID) <= 0 then 23 | 24 | -- check for hands 25 | if Self.Shield().id ~= BLANK_RUNE_ID and Self.Weapon().id ~= BLANK_RUNE_ID then 26 | 27 | -- disable Runemaker. 28 | Rifbot.setCheckboxState("runemaker", "enabled", false) 29 | 30 | -- logout 31 | Self.Logout() 32 | 33 | end 34 | 35 | end 36 | 37 | end 38 | 39 | end) -------------------------------------------------------------------------------- /Mouse Click Reconnect Nostalrius.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Mouse Click Reconnect Nostalrius 3 | Description: Click on screen to enable logout panel. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local MOUSECLICK = {x = 700, y = 500} -- where to click before pressing Enter to relogin. 8 | local DELAY = 5 -- time every we click mouse in seconds 9 | 10 | -- DONT EDIT BELOW THIS LINE 11 | 12 | local clickTime = 0 13 | 14 | Module.New("Mouse Click Reconnect Nostalrius", function() 15 | 16 | -- when not connected 17 | if not Self.isConnected() then 18 | 19 | -- when delay is valid 20 | if os.clock() - clickTime >= DELAY then 21 | 22 | -- click mouse (right) 23 | Rifbot.MouseClick(MOUSECLICK.x, MOUSECLICK.y, 1) 24 | 25 | -- update time 26 | clickTime = os.clock() 27 | 28 | end 29 | 30 | else 31 | 32 | -- we are online reset time 33 | clickTime = 0 34 | 35 | end 36 | 37 | end) 38 | -------------------------------------------------------------------------------- /Player Logout.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Player Logout 3 | Description: Logout your character when player detect on (range: x = [-8, 9], y = [-6, 7]). 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SAFE_LIST = {"friend1", "friend2"} -- set a safe list 8 | 9 | Module.New("Player Logout", function (mod) 10 | if Self.isConnected() then 11 | local players = Creature.iPlayers(9, false) -- get players with max range only on my floor 12 | for i = 1, #players do 13 | local player = players[i] 14 | if not table.find(SAFE_LIST, player.name) then 15 | Self.Logout() 16 | Rifbot.ConsoleWrite("[" .. os.date("%X") .. "] logged due a player detected: " .. player.name) -- set message to Rifbot Console. 17 | break 18 | end 19 | end 20 | end 21 | mod:Delay(200) -- set module execution 200ms (Can not be fast than 200ms!) 22 | end) 23 | -------------------------------------------------------------------------------- /Switch SSA Aol.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Switch SSA Aol 3 | Description: Equip SSA when hp below 90% until hp drop below 50% then wear aol 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SSA = 3081 -- ID of stone skin amulet 8 | local AOL = 3057 -- ID amulet of loss 9 | local HPPERC = 50 -- when hpperc below or equal wear aol, else wear ssa 10 | local HPPERC_TO_WEAR_SSA = 90 -- wear ssa only if hpperc < 90% 11 | 12 | Module.New("Switch SSA Aol", function () 13 | local hp = Self.HealthPercent() 14 | local amulet = Self.Amulet() 15 | if hp <= HPPERC then 16 | if amulet.id ~= AOL then 17 | Self.EquipItem(SLOT_AMULET, AOL, 1) 18 | end 19 | else 20 | if hp <= HPPERC_TO_WEAR_SSA then 21 | if amulet.id ~= SSA then 22 | Self.EquipItem(SLOT_AMULET, SSA, 1) 23 | end 24 | end 25 | end 26 | end) 27 | -------------------------------------------------------------------------------- /Use Piggy Banks.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Use Piggy Banks 3 | Description: Just use piggy bank and throw out trash. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | piggy_id = 2995, -- id of new piggy bank item 9 | trash = {2996, 3492} -- table of trash to throw out it under yourself 10 | } 11 | 12 | -- DON'T EDIT BELOW THIS LINE 13 | 14 | Module.New("Utrash door", function() 15 | if Self.isConnected() then 16 | local trash = Container.FindItem(config.trash) 17 | if table.count(trash) > 1 then 18 | local pos = Self.Position() 19 | Self.DropItem(pos.x, pos.y, pos.z, trash.id, trash.count, math.random(300, 500)) 20 | else 21 | local piggy = Container.FindItem(config.piggy_id) 22 | if table.count(piggy) > 1 then 23 | Container.UseItem(piggy.index, piggy.slot, piggy.id, false, 1000) -- use with delay 1000ms 24 | end 25 | end 26 | end 27 | end) -------------------------------------------------------------------------------- /Pickup Spear on Shortkey.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Pickup Separ on Shortkey 3 | Description: Will pickup spear from ground 1 sqm around you when you type Shortkey with command: EXECUTE scriptname 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SPEAR_ID = 3277 8 | 9 | -- DONT EDIT BELOW THIS LINE 10 | 11 | local pos = Self.Position() 12 | local weapon = Self.Weapon() 13 | local cap = Self.Capity() 14 | 15 | if weapon.id == 0 or weapon.id == SPEAR_ID then 16 | for x = -1, 1 do 17 | for y = -1, 1 do 18 | local map = Map.GetTopMoveItem(pos.x+x, pos.y+y, pos.z) 19 | if map.id == SPEAR_ID then 20 | local amount = map.count 21 | if amount * 20 > cap then 22 | amount = math.floor(cap / 20) 23 | end 24 | if amount > 0 then 25 | Self.EquipItemFromGround(SLOT_WEAPON, pos.x+x, pos.y+y, pos.z, SPEAR_ID, amount, 150) 26 | break 27 | end 28 | end 29 | end 30 | end 31 | end 32 | 33 | -------------------------------------------------------------------------------- /Cut Grass Around With Machete.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Cut Grass Around With Machete 3 | Description: Cut grass near you. 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | local config = { 9 | machete = 3308, -- id of item to cut 10 | grass = {3243, 2344} -- possible grass id 11 | } 12 | 13 | 14 | -- DON'T EDIT BELOW THIS LINE 15 | 16 | -- module 200ms or faster if teleported enabled 17 | Module.New("Cut Grass Around With Machete", function (mod) 18 | 19 | -- load self position 20 | local pos = Self.Position() 21 | 22 | -- load map around our character and use machete if grass found. 23 | for x = -1, 1 do 24 | for y = -1, 1 do 25 | if table.find(config.grass, Map.GetTopMoveItem(pos.x+x, pos.y+y, pos.z).id) then 26 | Self.UseItemWithGround(config.machete, pos.x+x, pos.y+y, pos.z, 1000) 27 | break -- destroy loop 28 | end 29 | end 30 | end 31 | 32 | -- module delay 33 | mod:Delay(400, 900) 34 | 35 | end) 36 | -------------------------------------------------------------------------------- /Stop Bot on Player.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Stop Bot on Player 3 | Description: Stop bot when player out of friends list is on screen else enable. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local FRIENDS = {"friend1", "friend2"} -- friends nicks to avoid 8 | local PAUSE_LUA_SCRIPTS = false -- disable lua scripts too !WARRING script don't restore bot again, you will need to manually press Ctrl+P 9 | 10 | -- DONT'T EDIT BELOW THIS LINE 11 | 12 | local list = table.lower(FRIENDS) 13 | 14 | Module.New("Stop Bot on Player", function () 15 | local players = Creature.iPlayers(7, false) -- get players on screen only 16 | for i = 1, #players do 17 | local player = players[i] 18 | if not table.find(list, string.lower(player.name)) then 19 | return Rifbot.setEnabled(false, PAUSE_LUA_SCRIPTS) -- disable player when player on screen. 20 | end 21 | end 22 | Rifbot.setEnabled(true) -- enable bot not players found 23 | end) 24 | -------------------------------------------------------------------------------- /Mana restore with monster essence.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Mana restore with monster essence 3 | Description: When detect monster essence item in opened containers then use it to restore mana. 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | local MANA_BELOW = 70 -- when your mpperc is below o equal this value character will use MONSTER_ESSENCE_ID. 9 | local SAFE_HEALTH = 50 -- dont restore mana if hpperc is below this value 10 | local MONSTER_ESSENCE_ID = 1234 -- id of monster essence 11 | local RUNE_DELAY = {1000, 1200} -- delay for use is default 1000ms we set a little bit higher. 12 | 13 | -- DONT'T EDIT BELOW THIS LINE 14 | 15 | Module.New("Mana restore with monster essence", function () 16 | if Self.ManaPercent() <= MANA_BELOW and Self.HealthPercent() > SAFE_HEALTH and Self.ItemCount(MONSTER_ESSENCE_ID) > 0 then 17 | Self.UseItemWithMe(MONSTER_ESSENCE_ID, math.random(RUNE_DELAY[1], RUNE_DELAY[2])) 18 | end 19 | end) -------------------------------------------------------------------------------- /Alert When Teleported.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Alert When Teleported 3 | Description: Play sound your character will teleported 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SQMS = 3 -- how many sqms diff poss to play sound 8 | local STOP_BOT = false -- stop bot or not when teleported 9 | 10 | -- DON'T EDIT BELOW THIS LINE 11 | 12 | local teleported, old = false, {x=0, y=0, z=0} 13 | 14 | -- MODULE 15 | Module.New("Alert When Teleported", function() 16 | if Self.isConnected() then 17 | if teleported then 18 | Rifbot.PlaySound("Default.mp3") 19 | if STOP_BOT then 20 | if Rifbot.isEnabled() then 21 | Rifbot.setEnabled(false) 22 | end 23 | end 24 | end 25 | local dist = Self.DistanceFromPosition(old.x, old.y, old.z) 26 | if dist >= SQMS and old.x ~= 0 then 27 | teleported = true 28 | end 29 | old = Self.Position() 30 | end 31 | end) 32 | -------------------------------------------------------------------------------- /Switch SSA Aol (Mana).lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Switch SSA Aol (Mana) 3 | Description: Equip SSA when mpperc below 90% until mperc drop below 30% then wear aol 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SSA = 3081 -- ID of stone skin amulet 8 | local AOL = 3057 -- ID amulet of loss 9 | local MPPERC = 30 -- when mpperc below or equal wear aol, else wear ssa 10 | local MPPERC_TO_WEAR_SSA = 95 -- wear ssa only if mpperc < 90% 11 | 12 | Module.New("Switch SSA Aol (Mana)", function () 13 | local mp = Self.ManaPercent() 14 | local amulet = Self.Amulet() 15 | if mp <= MPPERC or mp > MPPERC_TO_WEAR_SSA then 16 | if amulet.id ~= AOL then 17 | Self.EquipItem(SLOT_AMULET, AOL, 1, 0) -- delay 0 18 | end 19 | else 20 | if mp <= MPPERC_TO_WEAR_SSA then 21 | if amulet.id ~= SSA then 22 | Self.EquipItem(SLOT_AMULET, SSA, 1, 0) -- delay 0 23 | end 24 | end 25 | end 26 | end) 27 | -------------------------------------------------------------------------------- /Open Trap Under Yourself.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Open Trap Under Yourself 3 | Description: Use map to open trap under your character. 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | local CLOSED_TRAP_ID = 2920 -- id of closed trap 9 | local USE_DELAY = 500 -- delay between use 10 | 11 | -- DONT EDIT BELOW THIS LINE 12 | 13 | -- module run func in loop. 14 | Module.New("Open Trap Under Yourself", function () 15 | 16 | -- when connected. 17 | if Self.isConnected() then 18 | 19 | -- load self pos. 20 | local self = Self.Position() 21 | 22 | -- load map around you. 23 | local map = Map.GetTopMoveItem(self.x, self.y, self.z) 24 | 25 | -- when closed trap found 26 | if map.id == CLOSED_TRAP_ID then 27 | 28 | -- use item on map. 29 | return Map.UseItem(self.x, self.y, self.z, CLOSED_TRAP_ID, map.stack, USE_DELAY) 30 | 31 | end 32 | 33 | 34 | end 35 | 36 | end) 37 | -------------------------------------------------------------------------------- /Pickup MF around you.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Pickup MF around you 3 | Description: Pickup mana fluid around your character to empty backpack. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local MF_ID = 2874 -- set 2006 for old tibia 8 | 9 | -- DON'T EDIT BELOW 10 | 11 | Module.New("Pickup MF around you", function (mod) 12 | 13 | if Self.isConnected() then 14 | 15 | -- load self pos 16 | local pos = Self.Position() 17 | 18 | -- for loop 19 | for x = -1, 1 do 20 | 21 | for y = -1, 1 do 22 | 23 | -- load item 24 | local item = Map.GetTopMoveItem(pos.x+x, pos.y+y, pos.z) 25 | 26 | -- when mf id 27 | if item.id == MF_ID then 28 | 29 | -- Pickup item 30 | Self.PickupItem(pos.x+x, pos.y+y, pos.z, item.id, 1, Container.GetWithEmptySlots(), 0, 300) 31 | 32 | -- destroy loop 33 | break 34 | 35 | end 36 | 37 | end 38 | 39 | end 40 | 41 | end 42 | 43 | -- set module delay 44 | mod:Delay(300) 45 | 46 | end) 47 | -------------------------------------------------------------------------------- /Re-attack Monster.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Re-attack Monster 3 | Description: Keep attack monster by name. Re-check target after some time. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local ATTACK_MONSTER = "Monk" -- name of monster. 8 | local REATTACK_DELAY = 10 -- minutes after we re-attack monster 9 | 10 | -- DONT EDIT BELOW THIS LINE 11 | 12 | local atkMonster, atkTime = string.lower(ATTACK_MONSTER), os.time() 13 | 14 | Module.New("Re-attack Monster", function (mod) 15 | if os.time() - atkTime >= (REATTACK_DELAY * 60) then 16 | atkTime = os.time() 17 | Self.Stop() 18 | wait(300) 19 | end 20 | if Self.isConnected() and Self.TargetID() < 1 then 21 | local players = Creature.iMonsters(7, false) 22 | for i = 1, #players do 23 | local player = players[i] 24 | if string.lower(player.name) == atkMonster then 25 | Creature.Attack(player.id) 26 | break 27 | end 28 | end 29 | end 30 | mod:Delay(300, 700) 31 | end) 32 | -------------------------------------------------------------------------------- /Use LootSeller Item on Main Backpack.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Use LootSeller Item on Main Backpack 3 | Description: When your cap drop below CAP value then use ITEM_SELLER with main backpack. Important! seller item need to be in containers not EQ. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local ITEM_SELLER = 15737 -- id of seller item 8 | local CAP = 500 -- use only when cap below. 9 | 10 | Module.New("Use LootSeller Item on Main Backpack", function(mod) 11 | if Self.isConnected() then 12 | if Self.Capity() < CAP then 13 | local seller = Container.FindItem(ITEM_SELLER) 14 | if table.count(seller) > 2 then 15 | Container.UseItemWithEquipment(seller.index, seller.slot, seller.id, SLOT_BACKPACK, Self.Backpack().id, 0) 16 | else 17 | -- show error item not found 18 | print("LootSeller item not found inside opened containers.") 19 | end 20 | end 21 | end 22 | mod:Delay(500) 23 | end) -------------------------------------------------------------------------------- /Untrash door.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Untrash door 3 | Description: Throw out to dustbin items from door expect "allow_ids" 4 | Author: Ascer - example 5 | ]] 6 | 7 | local door = {x = 32334, y = 32234, z = 7} -- position of door on map 8 | local dustbin = {x = 32335, y = 32234, z = 7} -- position of dustbin on map 9 | local allow_ids = {99, 1630} -- put here ids to don't throw // 99 - id of alive creatures, 1630 or other is opened door id. 10 | local delay = 500 -- move items every this time in miliseconds 11 | 12 | -- DON'T EDIT BELOW THIS LINE 13 | 14 | -- moduke 15 | Module.New("Untrash door", function() 16 | if Self.DistanceFromPosition(door.x, door.y, door.z) <= 7 then 17 | local map = Map.GetTopMoveItem(door.x, door.y, door.z) 18 | if not table.find(allow_ids, map.id) then 19 | Map.MoveItem(door.x, door.y, door.z, dustbin.x, dustbin.y, dustbin.z, map.id, map.count, delay) -- throwing items to dustbin 20 | end 21 | end 22 | end) -------------------------------------------------------------------------------- /Alarm when pushed.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Alarm when pushed 3 | Description: Play sound when your character pushed. Run script when you will online only. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SOUND = "Creature Detected.mp3" -- sound name more inside Ribot folder\Alarms 8 | 9 | 10 | -- DON'T EDIT BELOW THIS LINE 11 | local pushed, startPos = false, Self.Position() 12 | 13 | 14 | Module.New("Alarm when pushed", function () 15 | 16 | -- when self is connected. 17 | if Self.isConnected() then 18 | 19 | -- when var contains true 20 | if pushed then 21 | 22 | -- play sound 23 | Rifbot.PlaySound(SOUND) 24 | 25 | -- check if all is fine. 26 | else 27 | 28 | -- when distance from pos is different than current we set. 29 | if Self.DistanceFromPosition(startPos.x, startPos.y, startPos.z) ~= 0 then 30 | 31 | -- set var. 32 | pushed = true 33 | 34 | end 35 | 36 | end 37 | 38 | end 39 | 40 | end) 41 | -------------------------------------------------------------------------------- /On off targeting if item count.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: On off targeting if item count 3 | Description: When item count below x value disable targeting else enable. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | item = {id = 3277, count = 0} -- @item.id type here is from game, @item.count type here min amount to disable targeting, default 0 9 | } 10 | 11 | 12 | -- mod to run functions 13 | Module.New("On off targeting if item count", function (mod) 14 | 15 | local amount = Self.ItemCount(config.item.id) 16 | local weapon = Self.Weapon() 17 | local shield = Self.Shield() 18 | local ammo = Self.Ammo() 19 | 20 | if weapon.id == config.item.id then amount = amount + weapon.count end 21 | if shield.id == config.item.id then amount = amount + shield.count end 22 | if ammo.id == config.item.id then amount = amount + ammo.count end 23 | 24 | if amount > config.item.count then 25 | if not Targeting.isEnabled() then Targeting.Enabled(true) end 26 | else 27 | if Targeting.isEnabled() then Targeting.Enabled(false) end 28 | end 29 | 30 | end) -------------------------------------------------------------------------------- /On off Magic Shooter if friend hpperc.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: On off Magic Shooter if friend hpperc 3 | Description: When some of your friend have low hpperc then disable magic shooter else enable. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | friendHpperc = 70 -- below this % value magic shooter will be off (don't counting your character) 9 | } 10 | 11 | -- DON'T EDIT BELOW THIS LINE 12 | 13 | function friendHaveLowHpperc(perc) 14 | local friends = Rifbot.FriendsList(true) 15 | for _, f in ipairs(Creature.iPlayers(7, false)) do 16 | if table.find(friends, string.lower(f.name)) then 17 | if f.hpperc <= perc then return true end 18 | end 19 | end 20 | return false 21 | end --> check if some of your friends have low hpperc 22 | 23 | 24 | Module.New("On off Magic Shooter if friend hpperc", function() 25 | if Self.isConnected() then 26 | if friendHaveLowHpperc(config.friendHpperc) then 27 | Rifbot.setCheckboxState("cavebot", "magic shooter", false) 28 | else 29 | Rifbot.setCheckboxState("cavebot", "magic shooter", true) 30 | end 31 | end 32 | end) -------------------------------------------------------------------------------- /Pickup Item Under Mouse.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Pickup Item Under Mouse 3 | Description: Pickup items under mouse cursor execute when shortkey pressed. 4 | Required: Script will execute once then unload. You need to set it on shortkey: EXECUTE pickup item under mouse 5 | Author: Ascer - example 6 | ]] 7 | 8 | local PICKUP_ITEMS = {3031, 3492, 2148} -- set id items to pickup 9 | local PICKUP_INDEX = -1 -- which backpack to pickup items. if you want any with empty slots then set -1 10 | 11 | -- DON'T EDIT BELOW 12 | 13 | function mousePick() 14 | local mouse = Rifbot.GetGroundPosUnderMouse() 15 | local item = Map.GetTopMoveItem(mouse.x, mouse.y, mouse.z) 16 | if table.find(PICKUP_ITEMS, item.id) then 17 | local backpack = PICKUP_INDEX 18 | if PICKUP_INDEX == (-1) then 19 | backpack = Container.GetWithEmptySlots() 20 | if backpack == (-1) then 21 | backpack = 0 22 | end 23 | end 24 | Self.PickupItem(mouse.x, mouse.y, mouse.z, item.id, item.count, backpack, 0, 0) 25 | end 26 | end 27 | 28 | -- call function 29 | mousePick() 30 | -------------------------------------------------------------------------------- /Spirit runemaker.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Spirit runemaker 3 | Description: Make runes based on spirit value (available for specific servers like Elderan). 4 | Required: Rifbot version 2.47+ 2022-12-21 5 | Author: Ascer - example 6 | ]] 7 | 8 | local config = { 9 | spell = "adori", -- spell to cast 10 | spiritPercent = 90, -- when spirit percent is equal or above this value character will make rune. 11 | randomize = {-5, 5}, -- randomize spirit percent while creating runes, ~5% 12 | castTimes = 1, -- cast spell once or more. 13 | } 14 | 15 | -- DON'T EDIT BELOW THIS LINE 16 | 17 | local randPerc = config.spiritPercent + math.random(config.randomize[1], config.randomize[2]) 18 | 19 | Module.New("Spirit runemaker", function(mod) 20 | if Self.isConnected() then 21 | if Self.SpiritPercent() >= randPerc then 22 | for i = 1, config.castTimes do 23 | Self.Say(config.spell) 24 | wait(2200, 3000) 25 | end 26 | randPerc = config.spiritPercent + math.random(config.randomize[1], config.randomize[2]) 27 | end 28 | end 29 | mod:Delay(500, 1000) 30 | end) 31 | -------------------------------------------------------------------------------- /Alert on Default and Private Message.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Alert on Default and Private Message 3 | Description: Play sound if someone send message on default or private. Safe list = Friends.txt 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | local IGNORE_MESSAGES = {enabled = false, keywords = {"exura", "exura gran", "utevo lux"}} -- ignore common messages lower case use only 9 | 10 | -- DON'T EDIT BELOW THIS LINE 11 | 12 | local list = Rifbot.FriendsList(true) 13 | 14 | --> here we adding our character name to safe list of message alert 15 | local selfName = string.lower(Self.Name()) 16 | table.insert(list, selfName) 17 | 18 | function proxy(messages) 19 | for i, msg in ipairs(messages) do 20 | if not table.find(list, string.lower(msg.speaker)) and msg.mode <= 5 and msg.channel <= 5 then 21 | if not IGNORE_MESSAGES.enabled or (IGNORE_MESSAGES.enabled and not table.find(IGNORE_MESSAGES.keywords, string.lower(msg.message))) then 22 | Rifbot.PlaySound("Default.mp3") 23 | end 24 | end 25 | end 26 | end 27 | 28 | -- register proxy message 29 | Proxy.New("proxy") 30 | -------------------------------------------------------------------------------- /Fast UH Healing.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Fast UH Healing 3 | Description: Restore health using uh rune. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local RUNE_DELAY = 1000 -- time between using rune. Default min delay on use uh is 1000ms 8 | local HPPERC_BELOW = 50 --when your hpperc is below or equal this value 9 | local RUNEID = 3160 -- UH id 10 | local USE_ONLY_IF_MANA_BELOW = {enabled = false, mana = 160} -- use uh only if you have low mana. @enabled - true/false, @mana - use if mana below this value 11 | 12 | -- DONT'T EDIT BELOW THIS LINE 13 | 14 | -- module to run in loop 200ms 15 | Module.New("Fast UH Healing", function () 16 | 17 | -- when connected 18 | if Self.isConnected() then 19 | 20 | -- check if mana enabled 21 | local var = (USE_ONLY_IF_MANA_BELOW.enabled and Self.Mana() <= USE_ONLY_IF_MANA_BELOW.mana) or not USE_ONLY_IF_MANA_BELOW.enabled 22 | 23 | -- check for hpperc. 24 | if Self.HealthPercent() <= HPPERC_BELOW and var then 25 | Self.UseItemWithMe(RUNEID, RUNE_DELAY) 26 | end 27 | 28 | end 29 | 30 | end) 31 | -------------------------------------------------------------------------------- /Shoot Poison Field with Warlock.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Shoot Poison Field with Warlock 3 | Description: Shoot poison filed rune with warlock once he appear. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | monsters = {"Warlock", "rotworm"}, -- add here monster names 9 | runeid = 3172 -- rune to shoot 10 | } 11 | 12 | 13 | -- DONT'T EDIT BELOW THIS LINE 14 | 15 | config.monsters = table.lower(config.monsters) 16 | local storage, shootTime = {}, 0 17 | 18 | Module.New("Shoot Poison Field with Warlock", function () 19 | for i, mob in pairs(Creature.iMonsters(7, false)) do 20 | if table.find(config.monsters, string.lower(mob.name)) then 21 | if not table.find(storage, mob.id) then 22 | if os.clock() - shootTime > 2 then 23 | Self.UseItemWithCreature(mob, config.runeid, 0) 24 | table.insert(storage, mob.id) 25 | shootTime = os.clock() 26 | break 27 | end 28 | end 29 | end 30 | end 31 | end) -------------------------------------------------------------------------------- /Stop Bot on Health.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Stop Bot on Health 3 | Description: Stop bot when your health is below and enable when above value. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local HEALTH = 30 -- when hp points below then disable bot else enable 8 | local WAIT = 20 -- wait 20 seconds before enable bot again when you health growth. 9 | 10 | 11 | -- DONT'T EDIT BELOW THIS LINE 12 | 13 | Module.New("Stop Bot on Health", function () 14 | 15 | -- when mana is above config 16 | if Self.Health() <= HEALTH then 17 | 18 | -- if bot is running. 19 | if Rifbot.isEnabled() then 20 | 21 | -- disable bot 22 | Rifbot.setEnabled(false) 23 | 24 | end 25 | 26 | else 27 | 28 | -- if not is running bot 29 | if not Rifbot.isEnabled() then 30 | 31 | -- wait time 32 | wait(WAIT * 1000) 33 | 34 | -- enable bot 35 | Rifbot.setEnabled(true) 36 | 37 | end 38 | end 39 | 40 | end) 41 | -------------------------------------------------------------------------------- /Open Backpack for Blanks.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Open Backpack for Blanks 3 | Description: Open next backpack if no blank runes found. 4 | 5 | Remarks: You need to have blanks like this: backpack-> backpack (with 19 blanks and backpack) 6 | Author: Ascer - example 7 | ]] 8 | 9 | local BLANK_RUNE_ID = 2260 -- id of blank rune // new id: 3147 10 | local BACKPACK_ID = 4391 -- id of backpack with blank runes 11 | local SLOT = SLOT_WEAPON -- where you put blank runes SLOT_WEAPON or SLOT_SHIELD 12 | 13 | -- DON'T EDIT BELOW 14 | 15 | Module.New("Open Backpack for Blanks", function(mod) 16 | local blank = Container.FindItem(BLANK_RUNE_ID) 17 | local hand = selfGetEquipmentSlot(SLOT) 18 | if hand.id > 0 and hand.id ~= BLANK_RUNE_ID then 19 | Self.DequipItem(SLOT) 20 | elseif hand.id <= 0 then 21 | if not blank then 22 | local newCont = Container.FindItem(BACKPACK_ID) 23 | if table.count(newCont) > 1 then 24 | Container.UseItem(newCont.index, newCont.slot, newCont.id, false) -- open new container in this same index 25 | end 26 | end 27 | end 28 | mod:Delay(700, 1200) 29 | end) 30 | -------------------------------------------------------------------------------- /Attack only monsters with full hp.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Attack only monsters with full hp 3 | Description: Attack monsters with 100% hp, checking list and range. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local MONSTERS = {"troll", "rat"} -- monsters list to attack 8 | local RANGE = 5 -- range sqms to check 9 | local DELAY = {100, 200} -- attack random delay 10 | 11 | -- DON'T EDIT BELOW THIS LINE 12 | 13 | MONSTERS = table.lower(MONSTERS) 14 | 15 | function getTarget() 16 | local creatures = Creature.iMonsters(RANGE, false) 17 | for i = 1, #creatures do 18 | local creature = creatures[i] 19 | if table.find(MONSTERS, string.lower(creature.name)) and creature.hpperc == 100 then 20 | return creature 21 | end 22 | end 23 | return -1 24 | end 25 | 26 | 27 | Module.New("Attack only monsters with full hp", function(mod) 28 | if Self.isConnected() then 29 | local t = Self.TargetID() 30 | if t <= 0 then 31 | local target = getTarget() 32 | if table.count(target) > 1 then 33 | Creature.Attack(target.id) 34 | end 35 | end 36 | end 37 | mod:Delay(DELAY[1], DELAY[2]) 38 | end) 39 | -------------------------------------------------------------------------------- /Ban Spectators on Cast.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Ban Spectators on Cast 3 | 4 | Description: Auto ban new spectators joined to your cast. 5 | Required: Valid message about joined specator inside line 16 or 29. 6 | Author: Ascer - example 7 | ]] 8 | 9 | local USE_PROXY_TEXT = false -- true/false use different method to catching signals example on Kasteria 10 | 11 | if not USE_PROXY_TEXT then 12 | 13 | function proxy(messages) 14 | for i, msg in ipairs(messages) do 15 | if string.len(msg.speaker) < 2 then 16 | local spectator = string.match(msg.message, "(.+) has joined the cast") 17 | if spectator ~= nil then 18 | Self.Say("!cast ban " .. spectator) 19 | end 20 | end 21 | end 22 | end 23 | Proxy.New("proxy") 24 | 25 | else 26 | 27 | function proxy(messages) 28 | for i, msg in ipairs(messages) do 29 | local spectator = string.match(msg.message, "(.+) joins your stream.") 30 | if spectator ~= nil then 31 | Self.Say("!cast ban " .. spectator) 32 | end 33 | end 34 | end 35 | Proxy.TextNew("proxy") 36 | 37 | end 38 | -------------------------------------------------------------------------------- /Alert on keyword in game.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Alert on keyword in game 3 | Description: Check bot default/private/server log chats for specific keywords and alert when appear. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local KEYWORDS = {"<--- Xonk --->", "other keyword to detect#"} 8 | 9 | -- DON'T EDIT BELOW. 10 | 11 | function isKeyword(msg) 12 | for i = 1, #KEYWORDS do 13 | if string.instr(msg, KEYWORDS[i]) then 14 | return true 15 | end 16 | end 17 | return false 18 | end --> check if specific keyword from possible keywords list appear in message 19 | 20 | function proxyText(messages) 21 | for i, msg in ipairs(messages) do 22 | if isKeyword(msg.message) then 23 | print("proxyText: " .. msg.message, msg.mode) 24 | Rifbot.PlaySound() 25 | end 26 | 27 | end 28 | end 29 | Proxy.TextNew("proxyText") 30 | 31 | function proxy(messages) 32 | for i, msg in ipairs(messages) do 33 | if isKeyword(msg.message) then 34 | print("proxy: " .. msg.speaker, msg.message, msg.channel, msg.mode, msg.level) 35 | Rifbot.PlaySound() 36 | end 37 | 38 | end 39 | end 40 | Proxy.New("proxy") -------------------------------------------------------------------------------- /Wear boots if fire under feets.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Wear boots if fire under feets 3 | Description: When your character will walk on fire then will wear special boots else normal. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | fireSqm = {2121, 2122, 2123, 2124}, -- ids of ground fire. 9 | fireBoots = 1234, -- id of fire boots 10 | normalBoots = 3552 -- id of standard boots. 11 | } 12 | 13 | 14 | -- DON'T EDIT BELOW 15 | 16 | Module.New("Wear boots if fire under feets", function () 17 | if Self.isConnected() then 18 | local me = Self.Position() 19 | local map = Map.GetItems(me.x, me.y, me.z) 20 | local isFire = false 21 | for _, item in ipairs(map) do 22 | if table.find(config.fireSqm, item.id) then 23 | isFire = true 24 | break 25 | end 26 | end 27 | local boots = Self.Feet() 28 | if isFire then 29 | if boots.id ~= config.fireBoots then 30 | Self.EquipItem(SLOT_FEET, config.fireBoots, 1) 31 | end 32 | else 33 | if boots.id ~= config.normalBoots then 34 | Self.EquipItem(SLOT_FEET, config.normalBoots, 1) 35 | end 36 | end 37 | end 38 | end) -------------------------------------------------------------------------------- /Stop Bot on GM.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Stop Bot on GM 3 | Description: Stop bot when GM without invisible mode detected. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local UNPAUSE_AFTER_SECONDS = 60 -- enable bot after 60s 8 | 9 | 10 | -- DONT'T EDIT BELOW THIS LINE 11 | local detectTime = 0 12 | 13 | 14 | Module.New("Stop Bot on GM", function () 15 | local players = Creature.iPlayers(7, false) -- get players on screen only 16 | for i = 1, #players do 17 | local player = players[i] 18 | if string.instr(player.name, "GM ") or string.instr(player.name, "CM ") or string.instr(player.name, "Admin ") or string.instr(player.name, "ADM ") then 19 | Rifbot.PlaySound("Default.mp3") -- play sound 20 | detectedTime = os.clock() 21 | return Rifbot.setEnabled(false) 22 | end 23 | end 24 | -- enable bot after period of time. 25 | if detectedTime > 0 then 26 | if os.clock() - detectedTime > UNPAUSE_AFTER_SECONDS then 27 | if not Rifbot.isEnabled() then 28 | Rifbot.setEnabled(true) 29 | end 30 | end 31 | end 32 | end) 33 | -------------------------------------------------------------------------------- /Fishing Water Elementals.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Fishing Water Elementals 3 | Description: Using rod on water elementals for new map struct. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local MAIN_DELAY = {3000, 3500} -- miliseconds use fishing rod time 8 | local FISHING_ROD = 3483 -- fishing rod id 9 | local WATER_TILES = {5522} --ids of water fields 10 | 11 | -- DONT'T EDIT BELOW THIS LINE 12 | 13 | Module.New("Fishing Water Elementals", function (mod) 14 | if Self.isConnected() then 15 | local fishingPos = {} 16 | local pos = Self.Position() 17 | for x = -7, 7 do 18 | for y = -5, 5 do 19 | local map = Map.GetTopMoveItem(pos.x + x, pos.y + y, pos.z) 20 | if table.find(WATER_TILES, map.id) then 21 | table.insert(fishingPos, {x = pos.x + x, y = pos.y + y, z = pos.z}) 22 | end 23 | end 24 | end 25 | if table.count(fishingPos) > 0 then 26 | local tile = fishingPos[math.random(1, table.count(fishingPos))] 27 | 28 | Self.UseItemWithGround(FISHING_ROD, tile.x, tile.y, tile.z, 100) -- use fishing rod. 29 | end 30 | end 31 | mod:Delay(MAIN_DELAY[1], MAIN_DELAY[2]) -- set random delay 32 | end) 33 | 34 | 35 | -------------------------------------------------------------------------------- /Stop Walker and Logout after Time.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Stop Walker and Logout after Time 3 | Description: When you botting example 60 min and want to stop cavebot and logout when no fight mode use this lua. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | session_time = 60 -- time in minutes to to end botting and logout. 9 | } 10 | 11 | 12 | -- DON'T EDIT BELOW THIS LINE 13 | 14 | local setTime = os.clock() 15 | 16 | Module.New("Stop Walker and Logout after Time", function () 17 | 18 | -- when connected 19 | if Self.isConnected() then 20 | 21 | -- when time is above limit. 22 | if os.clock() - setTime >= config.session_time * 60 then 23 | 24 | -- disable walker and looter. 25 | if Walker.isEnabled() then Walker.Enabled(false) end 26 | if Looter.isEnabled() then Looter.Enabled(false) end 27 | 28 | -- when no fight mode then logout. 29 | if not Self.isInFight() then 30 | 31 | -- logout 32 | Self.Logout() 33 | 34 | wait(1000) 35 | 36 | -- show log 37 | print("Logout due session time end: " .. config.session_time) 38 | 39 | end 40 | 41 | end 42 | 43 | end 44 | 45 | end) 46 | -------------------------------------------------------------------------------- /On Low HP Drop Bp.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: On Low HP Drop Bp 3 | Description: Drop Backpack slot on x, y, z when your character have low hp. 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | local HPPERC = 50 -- drop bp if hpperc below 9 | local GROUND_POSITION = {32317, 32235, 7} -- drop to this ground pos 10 | 11 | 12 | -- DON'T EDIT BELOW THIS LINE 13 | 14 | Module.New(" On Low HP Drop Bp", function () 15 | 16 | -- if we are connected. 17 | if Self.isConnected() then 18 | 19 | -- load self health 20 | local hp = Self.HealthPercent() 21 | 22 | -- when hp below config value. 23 | if hp <= HPPERC then 24 | 25 | -- load backpack slot 26 | local backpack = Self.Backpack() 27 | 28 | -- when bp id > 0 29 | if backpack.id > 0 then 30 | 31 | -- drop on ground. 32 | Container.MoveItemFromEquipmentToGround(SLOT_BACKPACK, GROUND_POSITION[1], GROUND_POSITION[2], GROUND_POSITION[3], backpack.id, 1) 33 | 34 | end 35 | 36 | end 37 | 38 | end 39 | 40 | end) 41 | -------------------------------------------------------------------------------- /Utito Tempo If Monster.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Utito Tempo If Monster 3 | Description: Cast spell if monster on screen 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SPELL = { 8 | name = "Utito Tempo", -- spell name 9 | mana = 290, -- min mana to cast spell 10 | amount = 1, -- min monsters amount to cast spell 11 | delay = 10 -- cast every seconds 12 | } 13 | 14 | 15 | -- DON'T EDIT BELOW THIS LINE 16 | 17 | local spellTime = 0 18 | 19 | Module.New("Utito Tempo If Monster", function (mod) 20 | 21 | -- when connected 22 | if Self.isConnected() then 23 | 24 | -- check for delay 25 | if os.clock() - spellTime > SPELL.delay then 26 | 27 | -- load monsters 28 | local mobs = Creature.iMonsters(7, false) 29 | 30 | -- when monsters 31 | if table.count(mobs) >= SPELL.amount then 32 | 33 | -- check for mana 34 | if Self.Mana() >= SPELL.mana then 35 | 36 | -- cast spell. 37 | Self.Say(SPELL.name) 38 | 39 | -- update delay 40 | spellTime = os.clock() 41 | 42 | end 43 | 44 | end 45 | 46 | end 47 | 48 | end 49 | 50 | -- module delay 51 | mod:Delay(500) 52 | 53 | end) 54 | -------------------------------------------------------------------------------- /Pickup Stones under dummy.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Pickup Stones under dummy 3 | Description: Pickup stones under training dummy to weapon slot. 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | local STONE = 1781 -- stones id 9 | local DELAY = {2000, 3000} -- delay between pickup 10 | 11 | -- DONT EDIT BELOW THIS LINE 12 | 13 | Module.New("Pickup Stones under dummy", function(mod) 14 | 15 | -- load target id. 16 | local target = Self.TargetID() 17 | 18 | -- load creature based on target 19 | local t = Creature.getCreatures(target) 20 | 21 | -- when creature is valid. 22 | if table.count(t) > 2 then 23 | 24 | -- load position under target 25 | local map = Map.GetItems(t.x, t.y, t.z) 26 | 27 | -- inside loop check for items. 28 | for i, sqm in ipairs(map) do 29 | 30 | -- when item is stone 31 | if sqm.id == STONE then 32 | 33 | -- wear stone from ground 34 | Self.EquipItemFromGround(SLOT_WEAPON, t.x, t.y, t.z, sqm.id, sqm.count, 0) 35 | 36 | -- destroy loop 37 | break 38 | 39 | end 40 | 41 | end 42 | 43 | end 44 | 45 | -- set mod delay 46 | mod:Delay(DELAY[1], DELAY[2]) 47 | 48 | end) 49 | 50 | -------------------------------------------------------------------------------- /Cast Purification Spell.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Cast Purification Spell 3 | Description: When you hpperc decrease below x then character will cast purification spell once. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local spell = { 8 | hpperc = 70 , -- when hpperc will below. 9 | name = "purification", -- spell to cast 10 | time = 80 -- spell time in seconds 11 | } 12 | 13 | 14 | -- DONT'T EDIT BELOW THIS LINE 15 | local mainTime = -999 16 | 17 | 18 | -- mod to run functions 19 | Module.New("Cast Purification Spell", function () 20 | 21 | -- if we are connected to game. 22 | if Self.isConnected() then 23 | 24 | -- check if we should cast. 25 | if (os.clock() - mainTime) >= spell.time then 26 | 27 | -- when hpperc will below. 28 | if Self.HealthPercent() < spell.hpperc then 29 | 30 | -- cast spell 31 | Self.Say(spell.name) 32 | 33 | -- update time 34 | mainTime = os.clock() 35 | 36 | end 37 | 38 | end 39 | 40 | end 41 | 42 | end) 43 | -------------------------------------------------------------------------------- /Heal monster.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Heal monster 3 | Description: Heal monster using UH rune. Important! Script don't recognize it's you summon or not. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local MONSTER = "Demon Skeleton" -- monster name with Capital letters 8 | local HEAL_BELOW_PERC = 50 -- heal if creature perc is below. 9 | local RUNE_ID = 3160 -- rune id to use 10 | 11 | -- DONT EDIT BELOW THIS LINE 12 | 13 | Module.New("Heal monster", function () 14 | 15 | -- load creatures 16 | local creatures = Creature.iMonsters(7, false) 17 | 18 | -- in loop for creatures. 19 | for i = 1, #creatures do 20 | 21 | -- load single creature. 22 | local c = creatures[i] 23 | 24 | -- check if creature have below HEAL_BELOW_PERC and monster name is this same as config. 25 | if c.hpperc <= HEAL_BELOW_PERC and c.name == MONSTER then 26 | 27 | -- use rune with creature. 2050 is delay in ms. 28 | Self.UseItemWithCreature(c, RUNE_ID, 2050) 29 | 30 | -- break loop 31 | break 32 | 33 | end 34 | 35 | end 36 | 37 | end) 38 | -------------------------------------------------------------------------------- /Enable disable cavebot on mana.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Enable disable cavebot on mana 3 | Description: Disable cavebot on x% mana and enable on x% mana 4 | Author: Ascer - example 5 | ]] 6 | 7 | local MPPERC = {on = 95, off = 30} -- enable cavebot when mana % above (ON) and disable when mana below (OFF) 8 | 9 | 10 | -- DON'T EDIT BELOW THIS LINE 11 | 12 | 13 | Module.New("Enable disable cavebot on mana", function (mod) 14 | 15 | -- when connected. 16 | if Self.isConnected() then 17 | 18 | -- load mana 19 | local mp = Self.ManaPercent() 20 | 21 | -- when mana below disable cavebot. 22 | if mp <= MPPERC.off then 23 | 24 | if Walker.isEnabled() then Walker.Enabled(false) end 25 | if Targeting.isEnabled() then Targeting.Enabled(false) end 26 | if Looter.isEnabled() then Looter.Enabled(false) end 27 | 28 | -- mana above enable cavebot 29 | elseif mp >= MPPERC.on then 30 | 31 | if not Walker.isEnabled() then Walker.Enabled(true) end 32 | if not Targeting.isEnabled() then Targeting.Enabled(true) end 33 | if not Looter.isEnabled() then Looter.Enabled(true) end 34 | 35 | end 36 | 37 | end 38 | 39 | -- execute every 500ms 40 | mod:Delay(500) 41 | 42 | end) 43 | -------------------------------------------------------------------------------- /Magic Wall front of target.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Magic Wall front of target 3 | Description: Shoot magic wall rune front of target. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local MW_ID = 3180 -- id of magic wall rune 8 | 9 | -- DONT EDIT BELOW THIS LINE 10 | 11 | -- load target 12 | local target = Self.TargetID() 13 | 14 | -- when we have target. 15 | if target > 0 then 16 | 17 | -- load creature 18 | target = Creature.getCreatures(target) 19 | 20 | -- when successfully load creature 21 | if table.count(target) > 1 then 22 | 23 | -- get creature direction. 24 | local dir = target.direction 25 | 26 | -- set additional pos 27 | local x, y = 0, 0 28 | 29 | -- set position of target by dir. 30 | if dir == 0 then 31 | y = -1 32 | elseif dir == 1 then 33 | x = 1 34 | elseif dir == 2 then 35 | y = 1 36 | elseif dir == 3 then 37 | x = -1 38 | end 39 | 40 | -- throw magic wall 41 | Self.UseItemWithGround(MW_ID, target.x + x, target.y + y, target.z, 1000) 42 | 43 | end 44 | 45 | end -------------------------------------------------------------------------------- /Logout if no mana regen.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Logout if no mana regen 3 | Description: Logout from game if no mana regeneration for some time. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local NO_REGEN_FOR = 60 -- sec / when you don't gain any mana points for 60 sec script force logout. 8 | 9 | 10 | -- DONT'T EDIT BELOW THIS LINE 11 | local lastMana, regenTime = -1, 0 12 | 13 | 14 | Module.New("Logout if no mana regen", function () 15 | 16 | -- load mana points. 17 | local mana = Self.Mana() 18 | 19 | -- when mana is above or equal 0. 20 | if mana >= 0 then 21 | 22 | -- when current mana is different than lastMana and or we have full mana. 23 | if mana ~= lastMana or mana >= Self.ManaMax() then 24 | 25 | -- set last time. 26 | regenTime = os.clock() 27 | 28 | -- set last mana 29 | lastMana = mana 30 | 31 | end 32 | 33 | end 34 | 35 | -- when time we are no regen is longer than param 36 | if os.clock() - regenTime > NO_REGEN_FOR then 37 | 38 | -- logout. 39 | Self.Logout() 40 | 41 | -- reset time 42 | regenTime = os.clock() 43 | 44 | end 45 | 46 | end) -------------------------------------------------------------------------------- /Go label on private message.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Go label on private message 3 | Description: If your character receive message from other player "refill" then will go to label "back" 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | signals = { 9 | {signal = "refill", label = "back"}, -- signal table = {signal -> this you sent from main char, label -> receiver go to this label if signal.} 10 | -- your next here 11 | {signal = "stop", label = "wait for me"}, 12 | }, 13 | senders = {"nick1", "nick2"}, -- characters names we accept signal 14 | 15 | } 16 | 17 | -- DONT EDIT BELOW THIS LINE 18 | 19 | config.senders = table.lower(config.senders) 20 | 21 | function proxy(messages) 22 | for i, msg in ipairs(messages) do 23 | if table.find(config.senders, string.lower(msg.speaker)) then 24 | for j, sig in ipairs(config.signals) do 25 | if string.lower(msg.message) == string.lower(sig.signal) then 26 | Walker.Goto(sig.label) 27 | end 28 | end 29 | end 30 | end 31 | end 32 | Proxy.New("proxy") 33 | -------------------------------------------------------------------------------- /Auto Private Message Respond.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Auto Private Message Respond 3 | Description: Respond for message on chat 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | respond = {"Hello", "Hiho", "Hi"}, -- random message to pm respond 9 | once = true, -- true/false respond to player only once per 2h. 10 | } 11 | 12 | -- DONT EDIT BELOW THIS LINE 13 | local responded = {Self.Name()} 14 | 15 | 16 | function proxy(messages) 17 | for i, msg in ipairs(messages) do 18 | if msg.channel == 0 and msg.mode == 4 then 19 | msg.message = string.lower(msg.message) 20 | if not table.find(responded, msg.speaker) and config.once then 21 | Self.PrivateMessage(msg.speaker, config.respond[math.random(1, #config.respond)], 0) 22 | table.insert(responded, msg.speaker) 23 | print(msg.speaker .. ": " .. msg.message) 24 | --print(msg.speaker, msg.message, msg.channel, msg.mode, msg.level) 25 | end 26 | end 27 | end 28 | end 29 | 30 | 31 | -- module to remove already responded players every 2h 32 | Module.New("Remove storage", function(mod) 33 | responded = {Self.Name()} 34 | mod:Delay(1000*60*60*2) 35 | end) 36 | 37 | -- register new proxy 38 | Proxy.New("proxy") 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Fishing Through Window.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Fishing Through Window 3 | Description: Use fishing only in specific places. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | delay = {1000, 1500}, -- miliseconds use fishing rod time 9 | rod = 3483, -- fishinf rod id 10 | minCap = 10, -- dont fishing if cap below 11 | positions = {{-5, 0}, {-6, 0}, {-7, 0}, {-5, 1}, {-6, 1}, {-7, 1}, {-5, -1}, {-6, -1}, {-7, -1}, {5, 0}, {6, 0}, {7, 0}, {5, -1}, {6, -1}, {7, -1}, {5, 1}, {6, 1}, {7, 1}} -- where to fishing. Your pos in game is {0, 0} 12 | } 13 | 14 | -- DONT'T EDIT BELOW THIS LINE 15 | 16 | local selfloc, fishingPos = Self.Position(), {} 17 | 18 | Module.New("Fishing Through Window", function (mod) 19 | if Self.isConnected() then 20 | local pos = Self.Position() 21 | local cap = Self.Capity() 22 | 23 | -- set random tile to fish. 24 | if table.count(config.positions) > 0 and cap > config.minCap then 25 | local tile = config.positions[math.random(1, table.count(config.positions))] 26 | Self.UseItemWithGround(config.rod, pos.x + tile[1], pos.y + tile[2], pos.z, 100) -- use fishing rod. 27 | end 28 | 29 | end 30 | mod:Delay(config.delay[1], config.delay[2]) -- set random delay 31 | end) 32 | 33 | 34 | -------------------------------------------------------------------------------- /Close Game If No Runes.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Close Game If No Runes 3 | Description: Close Game client when no more blank runes (error proxy check) 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | local PATH = "C:\\batch.bat" -- path to file with batch.bat to run kill process. 9 | 10 | ---------------------------------------------------------------------------------------------- 11 | --> Function: setSignalToFile(path) 12 | --> Description: Create batch file with command to close specific process pid. 13 | --> Params: 14 | --> @pid - number id of process to kill 15 | --> Returns: void nothing. 16 | ---------------------------------------------------------------------------------------------- 17 | function createBatchFile(pid) 18 | file = io.open(PATH, 'w') 19 | file:write("taskkill /F /PID " .. pid) 20 | return file:close() 21 | end 22 | 23 | 24 | Module.New("Close Game If No Runes", function () 25 | if string.instr(Proxy.ErrorGetLastMessage(), "magic item to cast") then 26 | Proxy.ErrorClearMessage() -- we need to clear message manually. 27 | local client = Rifbot.getClientInfo() 28 | createBatchFile(client.pid) 29 | os.execute(PATH) 30 | end 31 | end) 32 | -------------------------------------------------------------------------------- /SD Enemies.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: SD Enemies 3 | Description: Shoot Sudden Death Rune in enemies depent on heal percent. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local USE_DELAY = {2000, 3000} -- we can use rune each 2s 8 | local SHOOT_BELOW = 30 -- shoot sd below 30% 9 | local ENEMIES = {"enemy1", "enemy2"} -- add enemies with Capital letter 10 | local RUNEID = 3155 -- sd rune 11 | 12 | -- DONT'T EDIT BELOW THIS LINE 13 | 14 | local useTime, useDelay = 0, 0 15 | 16 | Module.New("SD Enemies", function () 17 | if os.clock() - useTime < useDelay then -- check for time 18 | return 19 | end 20 | for i, player in pairs(Creature.iPlayers(7)) do 21 | if table.find(ENEMIES, player.name) then 22 | if player.hpperc <= SHOOT_BELOW then 23 | Self.UseItemWithCreature(player, RUNEID) 24 | if Self.TargetID() ~= player.id then 25 | Creature.Attack(player.id) 26 | end 27 | useTime = os.clock() 28 | useDelay = math.random(USE_DELAY[1], USE_DELAY[2])/1000 -- set new random delay 29 | break -- end loop 30 | end 31 | end 32 | end 33 | end) 34 | -------------------------------------------------------------------------------- /Login to game after time.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Login to game after time 3 | Description: If your character is offline longer than e.g. 30 min will login to game. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local LOGIN_AFTER = 30 -- minutes under offline to be able login to game. 8 | 9 | 10 | -- DONT EDIT BELOW THIS LINE 11 | 12 | local logoutTime = 0 13 | 14 | Module.New("Login to game after time", function (mod) 15 | 16 | -- when you are online 17 | if Self.isConnected() then 18 | 19 | -- reset time 20 | logoutTime = 0 21 | 22 | else 23 | 24 | -- when logout time is 0 25 | if logoutTime == 0 then 26 | 27 | -- set new timer 28 | logoutTime = os.time() 29 | 30 | else 31 | 32 | -- check if we can login to game. 33 | if os.time() - logoutTime >= (60 * LOGIN_AFTER) then 34 | 35 | -- login to game standard option sending key enter, for classicTibia use func: classicTibiaRelogin() 36 | Rifbot.PressKey(13, 3000) 37 | 38 | end 39 | 40 | end 41 | 42 | end 43 | 44 | -- module execution delay in ms. 45 | mod:Delay(500, 1500) 46 | 47 | end) 48 | -------------------------------------------------------------------------------- /Wear Life Ring if Low Mana.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Wear Life Ring if Low Mana 3 | Description: Equip Life ring when mana % below value else dequip. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local MANA_PERC = 50 -- wear ring below this value else dequip 8 | local LIFE_RING = {on = 3089, off = 3052} -- set id for life ring on - equiped, off - not 9 | 10 | -- DONT EDIT BELOW THIS LINE 11 | 12 | Module.New("Wear Life Ring if Low Mana", function () 13 | 14 | -- when connected to game 15 | if Self.isConnected() then 16 | 17 | -- when low mana 18 | if Self.ManaPercent() <= MANA_PERC then 19 | 20 | -- when our slot.ring.id is different than life_ring.on 21 | if Self.Ring().id ~= LIFE_RING.on then 22 | 23 | -- equip ring 0 delay. 24 | Self.EquipItem(SLOT_RING, LIFE_RING.off, 1, 0) 25 | 26 | end 27 | 28 | else 29 | 30 | -- when our slot.ring.id is this same as life ring on 31 | if Self.Ring().id == LIFE_RING.on then 32 | 33 | -- dequip ring. 34 | Self.DequipItem(SLOT_RING) 35 | 36 | end 37 | 38 | end 39 | 40 | end 41 | 42 | end) 43 | -------------------------------------------------------------------------------- /Runemaker.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Runemaker 3 | Description: Making runes or cast spell in game. Checking for no blank runes. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local MAIN_DELAY = {400, 1700} -- delay in milisecond random actions 8 | local MANA_ABOVE = 80 -- MANA POINTS above this cast spell 9 | local SPELL = "adura vita" -- spell to cast 10 | 11 | local NO_BLANKS = { -- when no blank runes: 12 | castSpell = true, -- cast spell: true/false 13 | spell = "exura", -- spell to cast 14 | logout = false -- logout true/false 15 | } 16 | 17 | -- DONT'T EDIT BELOW THIS LINE 18 | 19 | Module.New("Runemaker", function (mod) 20 | if Self.Mana() >= MANA_ABOVE then 21 | if string.instr(Proxy.ErrorGetLastMessage(), "magic item to cast") then 22 | if NO_BLANKS.logout then 23 | Self.Logout() 24 | Rifbot.ConsoleWrite("[" .. os.date("%X") .. "] logged due a no more blank runes") -- set message to Rifbot Console. 25 | else 26 | if NO_BLANKS.castSpell then 27 | Self.CastSpell(NO_BLANKS.spell) 28 | end 29 | end 30 | Proxy.ErrorClearMessage() -- we need to clear message manually. 31 | else 32 | Self.CastSpell(SPELL) 33 | end 34 | end 35 | mod:Delay(MAIN_DELAY[1], MAIN_DELAY[2]) -- set random delay 36 | end) -------------------------------------------------------------------------------- /SSA & Might Ring on Mana.lua: -------------------------------------------------------------------------------- 1 | 2 | --[[ 3 | Script Name: Switch Might Ring Other Ring if Mana 4 | Description: Equip might ring & SSA when mana below x else wear other ring 5 | Author: Ascer - example 6 | ]] 7 | 8 | local AMULET_ID = 3081 -- id amulet to wear (default ssa 3081) 9 | local MIGHT_RING = 3048 -- id of might ring 10 | local OTHER_RING = 3010 -- id of ther ring 11 | local MPPERC = 40 -- when mpperc below this value wear might ring and ssa else wear other ring. 12 | 13 | --> SSA 14 | Module.New("Switch SSA", function (mod) 15 | local mp = Self.ManaPercent() 16 | local amulet = Self.Amulet() 17 | if mp <= MPPERC then 18 | if amulet.id ~= AMULET_ID then 19 | Self.EquipItem(SLOT_AMULET, AMULET_ID, 1, 0) 20 | end 21 | end 22 | end) 23 | 24 | --> Might ring 25 | Module.New("Switch Might Ring Other Ring if Mana", function () 26 | local mp = Self.ManaPercent() 27 | local ring = Self.Ring() 28 | if mp <= MPPERC then 29 | if ring.id ~= MIGHT_RING then 30 | Self.EquipItem(SLOT_RING, MIGHT_RING, 1, 0) 31 | end 32 | else 33 | if ring.id ~= OTHER_RING then 34 | Self.EquipItem(SLOT_RING, OTHER_RING, 1, 0) 35 | end 36 | end 37 | end) 38 | 39 | 40 | -------------------------------------------------------------------------------- /Count Strange Mana Regen.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Count Strange Mana Regen 3 | Description: Count avg mana regeneration per tick (results in Information Box). 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | -- DON'T EDIT BELOW THIS LINE 9 | local lastMana, tick, tickClock, tickTime, tickCount, tickMana = Self.Mana(), 0, os.clock(), 0, 0, 0 10 | 11 | -- mod to run function in loop 200ms 12 | Module.New("Count Strange Mana Regen", function () 13 | 14 | -- when connected 15 | if Self.isConnected() then 16 | 17 | -- load self mana. 18 | local mp = Self.Mana() 19 | 20 | -- when last mana is diff than currnet 21 | if mp > lastMana then 22 | 23 | -- calculate diff of mana regen 24 | local diff = (os.clock() - tickClock) * 1000 25 | 26 | -- update tickTime 27 | tickClock = os.clock() 28 | 29 | -- increase tickTime 30 | tickTime = tickTime + diff 31 | 32 | -- increase tickCount 33 | tickCount = tickCount + 1 34 | 35 | -- calculate tickMana 36 | tickMana = tickMana + (mp - lastMana) 37 | 38 | end 39 | 40 | -- update lastMana 41 | lastMana = mp 42 | 43 | end 44 | 45 | printf("Avg tick mana regen is " .. math.floor(tickMana / tickCount) .. " mana per " .. math.floor(tickTime / tickCount) / 1000 .. " sec." ) 46 | 47 | end) 48 | -------------------------------------------------------------------------------- /Use Rope Around.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Use Rope Around 3 | Description: Character will use rope item around you 1sqm. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local USE_DELAY = 1000 -- use every 1000 miliseconds (default) 8 | local ROPE_ID = 3003 -- id of rope. 9 | 10 | 11 | -- DONT'T EDIT BELOW THIS LINE 12 | 13 | local lastPos = Self.Position() 14 | local tablePos = {{-1, -1}, {-1, 0}, {-1, 1}, {1, -1}, {1, 0}, {1, 1}, {0, 1}, {0, -1}} 15 | local offset = 1 16 | 17 | 18 | -- run function in loop here 19 | Module.New("Use Rope Around", function (mod) 20 | 21 | -- load pos 22 | local pos = Self.Position() 23 | 24 | -- when current pos is diff than last pos reset offset 25 | if pos.x ~= lastPos.x or pos.y ~= lastPos.y or pos.z ~= lastPos.z then 26 | 27 | -- rest offset 28 | offset = 1 29 | 30 | end 31 | 32 | -- set last pos 33 | lastPos = Self.Position() 34 | 35 | -- Use map. 36 | Self.UseItemWithGround(ROPE_ID, pos.x + tablePos[offset][1], pos.y + tablePos[offset][2], pos.z, 0) 37 | 38 | -- add offset 39 | offset = offset + 1 40 | 41 | -- when offset is equal or higher than 9 reset 42 | if offset >= 9 then 43 | 44 | offset = 1 45 | 46 | end 47 | 48 | -- set module delay. 49 | mod:Delay(USE_DELAY) 50 | 51 | end) -------------------------------------------------------------------------------- /Drop Vials.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Drop Vials 3 | Description: Drop empty vials under your character or near around. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local VIAL = {id = 2874, count = 0} -- vial id and count of vial slot. (DON'T CHANGE COUNT) 8 | local DROP_DELAY = {300, 1000} -- time between actions 9 | local RANDOMIZE_DROP_POS = false -- drop vial to random pos true/false 10 | 11 | -- DON'T EDIT BELOW THIS LINE 12 | 13 | Module.New("Drop Vials", function () 14 | local items = Container.getItems() 15 | for i = 1, #items do 16 | local cont = items[i] 17 | local contItems = cont.items 18 | for j = 1, #contItems do 19 | local item = contItems[j] 20 | if item.id == VIAL.id then 21 | if item.count == VIAL.count then 22 | local pos = Self.Position() 23 | local osx, osy = 0, 0 24 | if RANDOMIZE_DROP_POS then 25 | osx = math.random(-1, 1) 26 | osy = math.random(-1, 1) 27 | end 28 | Container.MoveItemToGround(cont.index, (j - 1), pos.x + osx, pos.y + osy, pos.z, item.id, item.count) -- this function at least parameter set default delay for move items check for more detail in Rifbot Lib.lua 29 | break 30 | end 31 | end 32 | end 33 | end 34 | mod:Delay(DROP_DELAY[1], DROP_DELAY[2]) 35 | end) 36 | -------------------------------------------------------------------------------- /Switch SSA.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Switch SSA 3 | Description: Equip SSA when mana or hp is below 40% and dequip if above. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local AMULET_ID = 3081 -- id amulet to wear (default ssa 3081) 8 | local TYPE = "mana" -- which value to read "mana" or "hp" 9 | local VALUE = 75 -- when mpperc or hpperc <= this percent then wear ssa else dequip. 10 | local ONLY_IF_PLAYER = false -- true/false wear amulet only if player on screen 11 | 12 | -- DON'T EDIT BELOW THIS LINE 13 | 14 | TYPE = string.lower(TYPE) 15 | 16 | Module.New("Switch SSA", function (mod) 17 | local val = 0 18 | if TYPE == "mana" then 19 | val = Self.ManaPercent() 20 | else 21 | val = Self.HealthPercent() 22 | end 23 | local amulet = Self.Amulet() 24 | local var = ((not ONLY_IF_PLAYER) or (ONLY_IF_PLAYER and table.count(Creature.iPlayers(7, false)) > 0)) 25 | if val <= VALUE and var then 26 | if amulet.id ~= AMULET_ID then 27 | Self.EquipItem(SLOT_AMULET, AMULET_ID, 1) 28 | end 29 | else 30 | if amulet.id == AMULET_ID then 31 | Self.DequipItem(SLOT_AMULET) -- dequip amulet 32 | end 33 | end 34 | -- mod:Delay(200) delay execute script default disabled 35 | end) 36 | -------------------------------------------------------------------------------- /Medivia Boost Knight.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: 3 | Description: Boost Knight with incuro mas par when monsters on screen 4 | Author: Ascer - example 5 | ]] 6 | 7 | local BOOT_PLAYER = "Nick Here" -- player to boots 8 | local DELAY = 10 -- cast spell every 10s 9 | 10 | -- DON'T EDIT BELOW THIS LINE 11 | 12 | function getCreature() 13 | 14 | local player, monster = false, false 15 | 16 | -- inside loop for monsters 17 | for i, c in pairs(Creature.iCreatures(7, false)) do 18 | 19 | -- when we found player 20 | if string.lower(c.name) == string.lower(BOOT_PLAYER) then player = true end 21 | 22 | -- set monster 23 | if Creature.isMonster(c) then monster = true end 24 | 25 | -- all found 26 | if player and monster then return true end 27 | 28 | end 29 | 30 | -- don't found 31 | return false 32 | 33 | end 34 | 35 | if player and monster then return true end 36 | Module.New("Medivia Boost Knight", function (mod) 37 | 38 | -- when found creature cast boot player 39 | if getCreature() then 40 | Self.CastSpell("incuro mas par \"" .. BOOT_PLAYER, 65, (DELAY * 1000)) 41 | end 42 | 43 | -- set some delay 44 | mod:Delay(500, 700) 45 | end) -------------------------------------------------------------------------------- /Change Wand if Monster hpperc.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Change Wand if Monster hpperc 3 | Description: Wear standard wand if monster hpperc is high and switch to wand which costs less mane ig monster hpperc is low. 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | local config = { 9 | strongWand = 3031, -- id of strong wand costs more mana 10 | weakWand = 3492, -- id of weak wand cost less mana 11 | hpperc = 10, -- hpperc of monster to wear weakWand 12 | } 13 | 14 | -- DON'T EDIT BELOW THIS LINE 15 | 16 | Module.New("Change Wand if Monster hpperc", function () 17 | if Self.isConnected() then 18 | local target = Self.TargetID() 19 | local targetMonster = Creature.getCreatures(target) 20 | if table.count(targetMonster) > 1 then 21 | local wand = Self.Weapon().id 22 | if targetMonster.hpperc <= config.hpperc then 23 | if wand ~= config.weakWand then 24 | Self.EquipItem(SLOT_WEAPON, config.weakWand, 1, 200) 25 | end 26 | else 27 | if wand ~= config.strongWand then 28 | Self.EquipItem(SLOT_WEAPON, config.strongWand, 1, 200) 29 | end 30 | end 31 | end 32 | end 33 | end) 34 | -------------------------------------------------------------------------------- /VIP Logout.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: VIP Logout 3 | Description: Logout when specific players are online 4 | Author: Ascer - example 5 | ]] 6 | 7 | local VIP_LIST = {"enemy1", "enemy2"} -- enter players here separated with comma 8 | local RELOGIN = { 9 | enabled = true, -- relogin true/false 10 | delay = 6 -- relogin after X minutes 11 | } 12 | 13 | -- DON'T EDIT BELOW THIS LINE 14 | 15 | local stime, reconnect = 0, false 16 | 17 | Module.New("VIP Logout", function () 18 | if Self.isConnected() then 19 | if VIP.isOnline(VIP_LIST) then 20 | Self.Logout() 21 | stime = os.clock() 22 | reconnect = true 23 | end 24 | else 25 | if RELOGIN.enabled then 26 | if reconnect then 27 | printf("Successfully logout due a VIP online. Relogin for " .. math.floor((RELOGIN.delay * 60) - (os.clock() - stime)) .. "s." ) 28 | wait(800, 1200) 29 | if os.clock() - stime > (60 * RELOGIN.delay) then 30 | Rifbot.PressKey(13) -- press enter key 31 | end 32 | else 33 | Rifbot.PressKey(13) 34 | wait(800, 1200) 35 | end 36 | end 37 | end 38 | end) -------------------------------------------------------------------------------- /Discover Creature Chests.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Discover Creature Chests 3 | Description: When you found creature chests on map, send pm to some ppls about position of chest. 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | local chests = {"Common Cursed Chest", "Rare Cursed Chest", "Epic Cursed Chest", "Legendary Cursed Chest"} -- chest names 9 | local receivers = {"Tom", "Kit", "Mat"} -- receivers names 10 | 11 | 12 | -- DON'T EDIT BELOW THIS LINE 13 | local chests = table.lower(chests) 14 | local storage = {} 15 | 16 | function foundInStorage(x, y, z) 17 | for _, pos in ipairs(storage) do 18 | if pos.x == x and pos.y == y and pos.z == z then return true end 19 | end 20 | return false 21 | end 22 | 23 | Module.New("Discover Creature Chests", function(mod) 24 | local me = Self.Position() 25 | for _, c in ipairs(Creature.iCreatures(7)) do 26 | if table.find(chests, string.lower(c.name)) and not foundInStorage(c.x, c.y, c.z) then 27 | for i = 1, #receivers do 28 | Self.PrivateMessage(receivers[i], "Found: " .. c.name .. " on pos: " .. c.x .. ", " .. c.y .. ", " .. c.z .. ".", 0) 29 | end 30 | table.insert(storage, {x = c.x, y = c.y, z = c.z}) 31 | end 32 | end 33 | mod:Delay(500) 34 | end) -------------------------------------------------------------------------------- /Drag Item under Your Character.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Drag Item under Your Character 3 | Description: Dragging items around you 1 sqm to your character position 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | items = {3031, 3492} -- items to drag 9 | } 10 | 11 | 12 | -- DON'T EDIT BELOW THIS LINE 13 | 14 | Module.New(" Drag Item under Your Character", function () 15 | 16 | -- when connected 17 | if Self.isConnected() then 18 | 19 | -- load self position 20 | local pos = Self.Position() 21 | 22 | -- in loop load items around you 23 | for x = -1, 1 do 24 | 25 | for y = -1, 1 do 26 | 27 | -- load item on map 28 | local map = Map.GetTopMoveItem(pos.x + x, pos.y + y, pos.z) 29 | 30 | -- when on map there is item and there is no your char position 31 | if (pos.x ~= 0 or pos.y ~= 0) and table.find(config.items, map.id) then 32 | 33 | -- move item to your char pos. 34 | Map.MoveItem(pos.x + x, pos.y + y, pos.z, pos.x, pos.y, pos.z, map.id, map.count, 0) -- 0 is delay in ms. 35 | 36 | end 37 | 38 | end 39 | 40 | end 41 | 42 | end 43 | 44 | end) 45 | -------------------------------------------------------------------------------- /Charge Ancient Helmet with Rubby.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Charge Ancient Helmet with Rubby. 3 | Description: Recharge helmet when is no longer adding you energy. Rubbies need to be inside backpack slot. 4 | Require: Rifbot version 1.63 or higher. 5 | Author: Ascer - example 6 | ]] 7 | 8 | local HELMET = 3229 -- id of helmet of ancients (used) no longer regenerate hp/mana, 9 | local RUBBY = 3030 -- id of rubby to charge helmet 10 | 11 | 12 | -- DONT'T EDIT BELOW THIS LINE 13 | 14 | Module.New("Charge Ancient Helmet with Rubby", function (mod) 15 | 16 | -- when helmet is used. 17 | if Self.Head().id == HELMET then 18 | 19 | -- find rubby item. 20 | local item = Container.FindItem(RUBBY, nil) 21 | 22 | -- when item has found. 23 | if item ~= false then 24 | 25 | -- helmet with rubby. 26 | Container.UseItemWithEquipmentOnContainer(SLOT_HEAD, HELMET, item.index, item.slot, item.id) 27 | 28 | -- replace line 26 with this if you want use rubby with helmet 29 | --Container.UseItemWithEquipment(item.index, item.slot, item.id, SLOT_HEAD, HELMET, 0) 30 | 31 | end 32 | 33 | end 34 | 35 | -- execution delay 36 | mod:Delay(1000, 1500) 37 | 38 | end) 39 | -------------------------------------------------------------------------------- /Healing - Key simulate.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Healing - Key simulate 3 | Description: Heal your character using keyboard simulate. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local MAIN_DELAY = {300, 500} -- loop reading values time 8 | local KEY_DELAY = {500, 1000} -- time in miliseconds between press key 9 | 10 | local HEALING = { 11 | {key = 0x70, hpperc = 50, mana = 80}, -- More important healing comes first in the table. 12 | {key = 0x71, hpperc = 70, mana = 40}, -- key in hex value 0x70 = F1, more you can find: http://www.kbdedit.com/manual/low_level_vk_list.html 13 | {key = 0x72, hpperc = 90, mana = 25} 14 | 15 | 16 | -- {item = 0x73, hpperc = 40, mana = 60} -- you can add more 17 | } 18 | 19 | Module.New("Healing - Key simulate", function (mod) 20 | if Self.isConnected() then 21 | local selfHpperc, selfMana = Self.HealthPercent(), Self.Mana() 22 | for i, mode in pairs(HEALING) do 23 | if selfHpperc <= mode.hpperc and selfMana >= mode.mana then 24 | Rifbot.PressKey(mode.key, math.random(KEY_DELAY[1], KEY_DELAY[2])) 25 | break 26 | end 27 | end 28 | end 29 | mod:Delay(MAIN_DELAY[1], MAIN_DELAY[2]) -- set random delay 30 | end) -------------------------------------------------------------------------------- /Paladin Custom Healing 8.0.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Paladin Custom Healing 8.0 3 | Description: Auto mana fluid and heal with exura vita, when low mana use uhs. 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | local AUTO_MF_UP_TO = 80 -- drink mana fluid up to 80% 9 | local HEAL = {spell = "exura vita", hpperc = 80, mana = 160} -- cast exura vita if hpperc is below 80% and mana above 160 10 | local UH_ID = 3160 11 | local MF_ID = 2874 12 | 13 | -- DON'T EDIT BELOW THIS LINE 14 | 15 | 16 | -- loop module. 17 | Module.New("Paladin Custom Healing 8.0", function () 18 | 19 | -- when connected. 20 | if Self.isConnected() then 21 | 22 | -- load mana, manapercent and healthpercent 23 | local mana = Self.Mana() 24 | local mpperc = Self.ManaPercent() 25 | local hpperc = Self.HealthPercent() 26 | 27 | -- when low hp. 28 | if hpperc <= HEAL.hpperc then 29 | 30 | -- when no mana to cast spell 31 | if mana < HEAL.mana then 32 | 33 | -- use uhs every 1000ms 34 | Self.UseItemWithMe(UH_ID, 1000) 35 | 36 | else 37 | 38 | -- cast spell. 39 | Self.Say(HEAL.spell) 40 | 41 | end 42 | 43 | else 44 | 45 | -- when mana percent below. 46 | if mpperc < AUTO_MF_UP_TO then 47 | 48 | Self.UseItemWithMe(MF_ID, 1000) 49 | 50 | end 51 | 52 | end 53 | 54 | end 55 | 56 | end) 57 | -------------------------------------------------------------------------------- /[on Shortkey] Switch Two Hand Weapon.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: [on Shortkey] Switch Two Hand Weapon 3 | Description: Switch weapon in slot, its shortkey usage script type: EXECUTE name 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | local config = { 9 | oneHand = 3286, -- one hand weapon id 10 | shield = 3425, -- shield 11 | twoHand = 3276 -- two hand weapon id 12 | } 13 | 14 | local shield, weapon, switch = Self.Shield(), Self.Weapon(), 0 15 | 16 | if weapon.id == config.oneHand then 17 | switch = 0 18 | elseif weapon.id == config.twoHand then 19 | switch = 1 20 | end 21 | 22 | Module.New("[on Shortkey] Switch Two Hand Weapon", function(mod) 23 | shield, weapon = Self.Shield(), Self.Weapon() 24 | if switch == 0 then 25 | if shield.id > 0 then 26 | Self.DequipItem(SLOT_SHIELD, -1, -1, 0) 27 | else 28 | if weapon.id ~= config.twoHand then 29 | Self.EquipItem(SLOT_WEAPON, config.twoHand, 1, 0) 30 | else 31 | Rifbot.KillScript(selfScriptName) 32 | end 33 | end 34 | else 35 | if weapon.id ~= config.oneHand then 36 | Self.EquipItem(SLOT_WEAPON, config.oneHand, 1, 0) 37 | else 38 | if shield.id ~= config.shield then 39 | Self.EquipItem(SLOT_SHIELD, config.shield, 1, 0) 40 | else 41 | Rifbot.KillScript(selfScriptName) 42 | end 43 | end 44 | end 45 | end) -------------------------------------------------------------------------------- /Read vials from green message.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Read vials from green message 3 | Description: Using proxy messages you can get amount of vials left and manage this situation 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | vials = 50, -- when amount of vials below 50 goto label 9 | label = "back" -- label where to go if vials below 10 | } 11 | 12 | -- DONT EDIT BELOW THIS LINE 13 | local received = false 14 | 15 | 16 | -- proxy text 17 | function proxyText(messages) 18 | for i, msg in ipairs(messages) do 19 | local vials = string.match(msg.message, "Using one of (.+) vials..") 20 | if vials ~= nil then 21 | if tonumber(vials) <= config.vials then 22 | if not received then 23 | Walker.Goto(config.label) 24 | received = true 25 | print("We have " .. vials .. " vials go to label: " .. config.label) 26 | break 27 | end 28 | else 29 | if received then 30 | print("Enable checking for low vials due current amount: " .. vials) 31 | end 32 | -- enable checking 33 | received = false 34 | end 35 | end 36 | end 37 | end 38 | 39 | -- register function 40 | Proxy.TextNew("proxyText") -------------------------------------------------------------------------------- /Drop Fish when Cap.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Drop Fish when Cap 3 | Description: Drop fish or other items under your character when reach limit capity from equipment and containers. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local FISH = {2667, 2668} -- items to drop 8 | local CAPITY = 50 -- when below capity drop fish 9 | local DROP_DELAY = {500, 1700} -- time between actions 10 | 11 | -- DON'T EDIT BELOW THIS LINE 12 | 13 | Module.New("Drop Fish when Cap", function() 14 | if Self.Capity() < CAPITY then 15 | local pos = Self.Position() 16 | local fishInContainers = Container.FindItem(FISH) 17 | if table.count(fishInContainers) > 1 then 18 | Self.DropItem(pos.x, pos.y, pos.z, fishInContainers.id, 100) -- we drop 100 this mean when will below this value drop full stack. 19 | else 20 | local weapon, shield, ammo, toDrop = Self.Weapon().id, Self.Shield().id, Self.Ammo().id, 0 21 | -- check for eq slots 22 | if table.find(FISH, weapon) then toDrop = weapon end 23 | if table.find(FISH, shield) then toDrop = shield end 24 | if table.find(FISH, ammo) then toDrop = ammo end 25 | if toDrop > 0 then 26 | Self.DropItem(pos.x, pos.y, pos.z, toDrop, 100) -- we drop 100 this mean when will below this value drop full stack. 27 | end 28 | end 29 | end 30 | mod:Delay(DROP_DELAY[1], DROP_DELAY[2]) -- mod delay 31 | end) 32 | -------------------------------------------------------------------------------- /Anti Push if Player.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Anti Push if Player 3 | Description: Drop shit under yourself if player detected. 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | local DROP_DELAY = {200, 400} -- loop reading module 9 | local TRASH = {3031, 3147, 3507, 3447} -- trash items, gold, blank rune, label 10 | local RANDOM_ITEM = true -- drop random item from trash 11 | 12 | -- DONT'T EDIT BELOW THIS LINE 13 | 14 | local dropTime, dropDelay, friends = 0, 0, Rifbot.FriendsList(true) 15 | 16 | 17 | function getPlayer() 18 | for i, c in pairs(Creature.iPlayers(7)) do 19 | if Creature.isOnScreen(c) then 20 | return true 21 | end 22 | end 23 | return false 24 | end 25 | 26 | Module.New("Anti Push if Player", function () 27 | if os.clock() - dropTime > dropDelay then -- check for delay 28 | local chooseItem = TRASH 29 | if RANDOM_ITEM then 30 | chooseItem = TRASH[math.random(#TRASH)] 31 | end 32 | local item = Container.FindItem(chooseItem) -- search item in container 33 | if item ~= false and getPlayer() then 34 | local pos = Self.Position() 35 | Container.MoveItemToGround(item.index, item.slot, pos.x, pos.y, pos.z, item.id, 1) -- move first found item from TRASH list with quantity 1 36 | dropTime = os.clock() 37 | dropDelay = math.random(DROP_DELAY[1], DROP_DELAY[2])/1000 -- set new delay 38 | end 39 | end 40 | end) -------------------------------------------------------------------------------- /Alarm On Mana.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Alarm On Mana 3 | Description: Play sound if your mana points are below or above MANA value. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | mana = 150, -- mana points value to active alarm if it will below or equal or above. 9 | typeOf = "below", -- type of mana to check possible are: "below", "equal", "above", "below-equal", "above-equal" 10 | pauseBot = false -- true/false pause bot with lua scripts. 11 | } 12 | 13 | -- DON'T EDIT BELOW THIS LINE 14 | config.typeOf = string.lower(config.typeOf) 15 | 16 | -- module run function inside loop 17 | Module.New("Alarm On Mana", function () 18 | if Self.isConnected() then 19 | local mp = Self.Mana() 20 | local cond = false 21 | if config.typeOf == "below" then 22 | cond = mp < config.mana 23 | elseif config.typeOf == "below-equal" then 24 | cond = mp <= config.mana 25 | elseif config.typeOf == "equal" then 26 | cond = mp == config.mana 27 | elseif config.typeOf == "above" then 28 | cond = mp > config.mana 29 | elseif config.typeOf == "above-equal" then 30 | cond = mp >= config.mana 31 | end 32 | if cond then 33 | Rifbot.PlaySound() 34 | if config.pauseBot then 35 | Rifbot.setEnabled(false, true) 36 | end 37 | print("Detected mana " .. config.typeOf .. " " .. config.mana .. " points.") 38 | end 39 | end 40 | end) 41 | -------------------------------------------------------------------------------- /Drop Fish and Burst Arrow.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Drop Fish and Burst Arrow 3 | Description: Drop fish and burst arrows when there is above 10 example. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | fish = {id = 2667, above = 10, pos = {x = 32344, y = 32224, z = 8}}, -- fish id, drop when amount above, pos x, y, z on map where to drop. 9 | burst = {id = 3449, above = 10, pos = {x = 32344, y = 32225, z = 8}} 10 | } 11 | 12 | 13 | -- DON'T EDIT BELOW THIS LINE 14 | 15 | Module.New("Drop Fish and Burst Arrow", function() 16 | 17 | -- when connected 18 | if Self.isConnected() then 19 | 20 | -- load amount of burst arrows 21 | local arrows = Self.ItemCount(config.burst.id) 22 | 23 | -- when amount is above limit. 24 | if arrows > config.burst.above then 25 | 26 | -- drop 27 | Self.DropItem(config.burst.pos.x, config.burst.pos.y, config.burst.pos.z, config.burst.id, (arrows - config.burst.above)) 28 | 29 | end 30 | 31 | -- load amount of fish 32 | local roach = Self.ItemCount(config.fish.id) 33 | 34 | -- when amount is above limit. 35 | if roach > config.fish.above then 36 | 37 | -- drop 38 | Self.DropItem(config.fish.pos.x, config.fish.pos.y, config.fish.pos.z, config.fish.id, (roach - config.fish.above)) 39 | 40 | end 41 | 42 | end 43 | 44 | -- set delay 45 | mod:Delay(400, 800) 46 | 47 | end) 48 | -------------------------------------------------------------------------------- /Switch Soft Boots with other.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Switch Soft Boots with other 3 | Description: Load soft boots when low mana and later switch to other boots. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SOFT_BOOTS = {using = 3549, notUsing = 6529} -- if of soft boots using (in equipment feet slot) and not using (in backpack) 8 | local OTHER_BOOTS = 3079 -- switch to this boots when mana above MANA_PERCENT 9 | local MANA_PERCENT = 80 -- check this mana percent to wear softs or not. 10 | 11 | 12 | -- DON'T EDIT BELOW THIS LINE 13 | 14 | Module.New("Switch Soft Boots with other", function (mod) 15 | 16 | -- load feet and mana. 17 | local feet = Self.Feet().id 18 | local mana = Self.ManaPercent() 19 | 20 | -- when low mana 21 | if Self.ManaPercent() < MANA_PERCENT then 22 | 23 | -- when no softs on 24 | if feet ~= SOFT_BOOTS.using then 25 | 26 | -- equip softs. 27 | Self.EquipItem(SLOT_FEET, SOFT_BOOTS.notUsing, 1) 28 | 29 | end 30 | 31 | else 32 | 33 | -- when no other boots. 34 | if feet ~= OTHER_BOOTS then 35 | 36 | -- equip other boots. 37 | Self.EquipItem(SLOT_FEET, OTHER_BOOTS, 1) 38 | 39 | end 40 | 41 | end 42 | 43 | mod:Delay(500, 1200) -- set a delay 44 | 45 | end) 46 | -------------------------------------------------------------------------------- /Advertising.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Advertising 3 | Description: Advert your message on Trade and Default channel as Yell. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local TRADE = {true, 180, 400} -- advert on trade true/false, random time: 180-400s 8 | local DEFAULT_YELL = {true, 80, 250} -- advert on default as yell true/false, random time: 80-250s 9 | 10 | local MESSAGES = { -- messages, could be single or group (if group then random) 11 | "Sell bps of uh, sd", 12 | "Buy golden account!" 13 | } 14 | 15 | 16 | -- DON'T EDIT BELOW THIS LINE 17 | 18 | local tradeTime, tradeDelay, yellTime, yellDelay = 0, 0, 0, 0 19 | 20 | Module.New("Advertising", function () 21 | local items = table.count(MESSAGES) 22 | if TRADE[1] then 23 | if os.clock() - tradeTime > tradeDelay then 24 | Self.SayOnChannel(MESSAGES[math.random(1, items)], CHANNEL_ADVERTISING) 25 | tradeTime = os.clock() 26 | tradeDelay = math.random(TRADE[2], TRADE[3]) -- divide by 1000 is no need sice os.clock() return seconds 27 | if DEFAULT_YELL[1] then 28 | wait(3000, 7000) -- wait between trade and yell message 29 | end 30 | end 31 | end 32 | if DEFAULT_YELL[1] then 33 | if os.clock() - yellTime > yellDelay then 34 | Self.Yell(MESSAGES[math.random(1, items)]) 35 | yellTime = os.clock() 36 | yellDelay = math.random(DEFAULT_YELL[2], DEFAULT_YELL[3]) 37 | end 38 | end 39 | end) 40 | -------------------------------------------------------------------------------- /Prioritize Demonic or Ranged Mobs.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Prioritize Demonic or Ranged Mobs 3 | Description: Switch target to monster special created. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | monsters = {"Demonic", "Ranged"}, -- special monsters added status 9 | range = 3 -- area in sqms we search for this mobs, warring! longer range may lead to attack not reachable targets 10 | } 11 | 12 | -- DON'T EDIT BELOW 13 | function isSpecialName(name) 14 | for i = 1, #config.monsters do 15 | if string.instr(name, config.monsters[i]) then 16 | return true 17 | end 18 | end 19 | return false 20 | end --> check is name is with special status 21 | 22 | function switchMonsterIfPossible() 23 | for _, c in ipairs(Creature.iMonsters(config.range)) do 24 | if isSpecialName(c.name) then 25 | Creature.Attack(c.id) 26 | return true 27 | end 28 | end 29 | return false 30 | end --> check for possible special monsters to attack and switch target. 31 | 32 | 33 | Module.New("Prioritize Demonic or Ranged Mobs", function() 34 | if Self.isConnected() then 35 | local t = Self.TargetID() 36 | if t > 0 then 37 | local mob = Creature.getCreatures(t) 38 | if table.count(mob) > 1 then 39 | if not isSpecialName(mob.name) then switchMonsterIfPossible() end 40 | end 41 | else 42 | switchMonsterIfPossible() 43 | end 44 | end 45 | end) -------------------------------------------------------------------------------- /Turn off looter if cap.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Turn off looter if cap 3 | Description: When capity will below x then turn off looter, else on. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | cap = {off = 50, on = 60} -- [off] when cap <= disable looter, [on] when cap >= enable 9 | } 10 | 11 | 12 | -- DON'T EDIT BELOW THIS LINE 13 | local offLooter = false 14 | 15 | Module.New("Turn off looter if cap", function() 16 | 17 | -- when connected. 18 | if Self.isConnected() then 19 | 20 | -- load capity. 21 | local cap = Self.Capity() 22 | 23 | -- when low cap 24 | if cap <= config.cap.off then 25 | 26 | -- when looter enabled->disable. 27 | if Looter.isEnabled() then 28 | Looter.Enabled(false) 29 | else 30 | offLooter = true 31 | end 32 | 33 | else 34 | 35 | -- when cap is above and param offLooter is true. 36 | if cap >= config.cap.on and offLooter then 37 | 38 | -- enable looter 39 | if not Looter.isEnabled() then 40 | Looter.Enabled(true) 41 | else 42 | offLooter = false 43 | end 44 | 45 | end 46 | 47 | end 48 | 49 | end 50 | 51 | end) 52 | -------------------------------------------------------------------------------- /Slime Training.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Slime Training 3 | Description: Fist recognize mother attack it and run script. Rifbot mark mother and will avoid it. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local MAIN_DELAY = {500, 1800} -- set your delay 8 | local MONSTER = "Slime" -- monster name 9 | local RANGE = 1 -- attack when moster distance from self = 1, set more if u're paladin 10 | 11 | -- DONT'T EDIT BELOW THIS LINE 12 | 13 | local mother = 0 14 | 15 | Module.New("Slime Training", function (mod) 16 | 17 | -- find and mark mother 18 | if mother <= 0 then 19 | local target = Self.TargetID() 20 | for i, mob in pairs(Creature.iMonsters(7)) do 21 | if mob.name == MONSTER then 22 | if target == mob.id then 23 | mother = mob.id 24 | Self.Stop() -- stop attack mother. 25 | break 26 | end 27 | end 28 | end 29 | else 30 | -- control monsters. 31 | local target = Self.TargetID() 32 | if target == mother then 33 | Self.Stop() -- stop attack if mother is target. 34 | end 35 | 36 | if target == 0 then -- do actions only if target.id = 0 37 | for i, mob in pairs(Creature.iMonsters(RANGE)) do 38 | if mob.name == MONSTER and mob.id ~= mother then 39 | Creature.Attack(mob.id) -- attack slime summon 40 | break 41 | end 42 | end 43 | end 44 | end 45 | 46 | mod:Delay(MAIN_DELAY[1], MAIN_DELAY[2]) -- set random delay 47 | end) 48 | -------------------------------------------------------------------------------- /Heal with spell if no monsters.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Heal with spell if no monsters 3 | Description: Cast healing spell when no monsters on screen. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | spell = "exura", -- cast spell 9 | hpperc = 90, -- cast when hpperc below 10 | mana = 25 -- mana required to cast spell 11 | } 12 | 13 | 14 | -- DON'T EDIT BELOW THIS LINE 15 | 16 | ---------------------------------------------------------------------------------------------------------------------------------------------------------- 17 | --> Function: getMonsters() 18 | --> Description: Read creatures for monsters on screen. 19 | --> Class: None 20 | --> Params: None 21 | --> Return: boolean true or false 22 | ---------------------------------------------------------------------------------------------------------------------------------------------------------- 23 | function getMonsters() 24 | for i, mob in pairs(Creature.iMonsters(7, false)) do 25 | return true 26 | end 27 | return false 28 | end 29 | 30 | -- loop module. 31 | Module.New("Heal with spell if no monsters", function () 32 | 33 | -- when health below 34 | if Self.HealthPercent() < config.hpperc then 35 | 36 | -- when no monsters. 37 | if not getMonsters() then 38 | 39 | -- cast spell, mana, delay. 40 | Self.CastSpell(config.spell, config.mana, 500) 41 | 42 | end 43 | 44 | end 45 | 46 | end) 47 | -------------------------------------------------------------------------------- /Move Platinums To Arrow Slot.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Move Platinums To Arrow Slot 3 | Description: Stack platinum coins inside arrow (ammo) slot up to 100 4 | Author: Ascer - example 5 | ]] 6 | 7 | local PLATINUM = 3035 -- id of platinum coins 8 | 9 | -- DON'T EDIT BELOW THIS LINE 10 | 11 | Module.New("Move Platinums To Arrow Slot", function (mod) 12 | 13 | -- when self connected. 14 | if Self.isConnected() then 15 | 16 | -- load arrow slot 17 | local arrow = Self.Ammo() 18 | 19 | -- when arrow id is different than platinum coins or count is below 100 20 | if arrow.id ~= PLATINUM or arrow.count < 100 then 21 | 22 | -- load platinum in containers 23 | local item = Container.FindItem(PLATINUM) 24 | 25 | -- when item found 26 | if item ~= false then 27 | 28 | -- set valid amount to move 29 | local toMove = item.count 30 | 31 | -- when count is above limit set new amount 32 | if toMove > (100 - arrow.count) then toMove = (100 - arrow.count) end 33 | 34 | -- shove to ammo slot 35 | Container.MoveItemToEquipment(item.index, item.slot, SLOT_AMMO, item.id, toMove) 36 | 37 | end 38 | 39 | end 40 | 41 | end 42 | 43 | -- mod delay 44 | mod:Delay(500, 1000) 45 | 46 | end) -------------------------------------------------------------------------------- /Players Detected - Ering.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Players Detected - Ering 3 | Description: Play sound if any monster or player attack you. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local PLAYERS = 1 -- amount of players on screen to put ring 8 | local RING = 3051 -- ID of no-active ring. 9 | local RING_ACTIVE = 3088 -- id of active ring in eq. 10 | local DEQUIP = true -- true/false dequip ring when players leave screen. 11 | local SAFE_LIST = {"Friend1", "Friend2"} -- add here friends to avoid. 12 | 13 | -- DON'T EDIT BELOW THIS LINE 14 | 15 | local friends = table.lower(SAFE_LIST) 16 | 17 | Module.New("Players Detected - Ering", function () 18 | local count = 0 19 | for i, player in pairs(Creature.iPlayers(7)) do 20 | if not table.find(friends, player.name) then 21 | count = count + 1 22 | if count >= PLAYERS then 23 | if not Self.isManaShielded() then 24 | Self.EquipItem(SLOT_RING, RING, 1) 25 | break -- break loop 26 | end 27 | end 28 | end 29 | end 30 | if DEQUIP then 31 | if count < PLAYERS then 32 | if Self.Ring().id == RING_ACTIVE then 33 | Self.DequipItem(SLOT_RING) 34 | end 35 | end 36 | end 37 | end) 38 | -------------------------------------------------------------------------------- /Pseudo looter (old map).lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Pseudo looter (old map) 3 | Description: {Only for classic tibie 7.4 game client not for newer otclient}. Use map ground based on last target position if it will open 50-80% corpses will success. 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | 9 | local lastT = -1 10 | 11 | function test() 12 | local t = Self.TargetID() 13 | if t > 0 then 14 | local c = Creature.getCreatures(t) 15 | if table.count(c) > 0 then 16 | if table.count(lastT) > 0 then 17 | if lastT.id ~= c.id then 18 | wait(1000) 19 | Map.UseItem(lastT.x, lastT.y, lastT.z, getPseudoTop(lastT.x, lastT.y, lastT.z), 0, 0) 20 | lastT = -1 21 | end 22 | end 23 | lastT = c 24 | end 25 | else 26 | if table.count(lastT) > 0 then 27 | wait(1000) 28 | Map.UseItem(lastT.x, lastT.y, lastT.z, getPseudoTop(lastT.x, lastT.y, lastT.z), 0, 0) 29 | lastT = -1 30 | end 31 | end 32 | end 33 | 34 | function getPseudoTop(x, y, z) 35 | local map = Map.getArea(2) -- load map with 2 sqm range 36 | for i, square in pairs(map) do 37 | if square.x == x and square.y == y and square.z == z then 38 | local sqareItems = square.items 39 | local idt = 0 40 | for j, item in pairs(sqareItems) do 41 | idt = item.id 42 | end 43 | return idt 44 | end 45 | end 46 | end 47 | 48 | 49 | Module.New("Pseudo looter (old map)", function() 50 | test() 51 | end) 52 | 53 | -------------------------------------------------------------------------------- /Switch Royal Spear with Spear.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Switch Royal Spear with Spear 3 | Description: When you hunting and drop royal spears then wear it instead of standard spear (infinite) 4 | Required: Adding to looter Royal Spears. 5 | Author: Ascer - example 6 | ]] 7 | 8 | local config = { 9 | spear = 3277, -- id of basic spear 10 | royal_spear = 7037 -- id of royal spear 11 | } 12 | 13 | -- DON'T EDIT BELOW 14 | 15 | Module.New("Switch Royal Spear with Spear", function () 16 | 17 | -- when connected 18 | if Self.isConnected() then 19 | 20 | -- load slot weapon 21 | local weapon = Self.Weapon() 22 | 23 | -- load amount of royal spears 24 | local count = Self.ItemCount(config.royal_spear) 25 | 26 | -- when we have royal spears in containers. 27 | if count > 0 then 28 | 29 | -- when current weapon is spear 30 | if weapon.id == config.spear then 31 | 32 | -- dequip spear to first empty container 33 | Self.DequipItem(SLOT_WEAPON) 34 | 35 | else 36 | 37 | -- equip royal spears. 38 | Self.EquipItem(SLOT_WEAPON, config.royal_spear, count, 300) 39 | 40 | end 41 | 42 | else 43 | 44 | -- when no weapon. 45 | if not table.find({config.spear, config.royal_spear}, weapon.id) then 46 | 47 | -- wear basic spear qt = 1 48 | Self.EquipItem(SLOT_WEAPON, config.spear, 1, 300) 49 | 50 | end 51 | 52 | end 53 | 54 | end 55 | 56 | end) -------------------------------------------------------------------------------- /Shutdown Pc at time.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Shutdow Pc at time 3 | Description: Turn off computer when time. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SHUTDOWN_TIME = "09:55" -- turn off pc when this time 8 | local SHUTDOWN_COMMAND = "shutdown /s /f /t 0" -- command to shutdown pc. 9 | local BATCH = "C:\\batch.bat" -- path to file with batch.bat to run kill process. 10 | 11 | 12 | -- DONT'T EDIT BELOW THIS LINE 13 | 14 | ---------------------------------------------------------------------------------------------- 15 | --> Function: createBatchFile() 16 | --> Description: Create batch file with command to shudown cpu. 17 | --> Params: 18 | --> @command - string command to execute. 19 | --> Returns: void nothing. 20 | ---------------------------------------------------------------------------------------------- 21 | function createBatchFile(command) 22 | file = io.open(BATCH, 'w') 23 | file:write(command) 24 | return file:close() 25 | end 26 | 27 | 28 | Module.New("Logout at time", function () 29 | 30 | -- get time 31 | local h, min = os.date("%H"), os.date("%M") 32 | 33 | -- when time is fine and not variable contains true 34 | if (h .. ":" .. min) == SHUTDOWN_TIME then 35 | 36 | -- create batch file 37 | createBatchFile(SHUTDOWN_COMMAND) 38 | 39 | -- execute command 40 | os.execute(BATCH) 41 | 42 | -- wait some time. 43 | wait(10000) 44 | 45 | end 46 | 47 | end) 48 | 49 | -------------------------------------------------------------------------------- /Off targeting for while if first monster.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Off targeting for while if first monster 3 | Description: Default targeting will be off but when see monster from list it will enable it back with delay to prevent fast bot attack. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | delay = 500, -- starting delay before attack first monster 500ms = 0.5s 9 | range = 6, -- search monsters in range (7 deafult full screen) 10 | list = {"Rat", "Hydra", "Behemoth", "Demon", "Serpent Spawn", "Dwarf Guard"} -- list monsters to search. 11 | } 12 | 13 | 14 | -- DON'T EDIT BELOW THIS LINE 15 | 16 | local startTime = 0 17 | 18 | config.list = table.lower(config.list) 19 | 20 | function getMonsters() 21 | for i, mob in pairs(Creature.iMonsters(config.range, false)) do 22 | if table.find(config.list, string.lower(mob.name)) then 23 | return true 24 | end 25 | end 26 | return false 27 | end 28 | 29 | Module.New("Off targeting for while if first monster ", function () 30 | if Self.isConnected() then 31 | if not getMonsters() then 32 | if Targeting.isEnabled() then 33 | Targeting.Enabled(false) 34 | startTime = 0 35 | end 36 | else 37 | if startTime <= 0 then 38 | startTime = os.clock() 39 | else 40 | if os.clock() - startTime >= config.delay/1000 then 41 | if not Targeting.isEnabled() then Targeting.Enabled(true) end 42 | end 43 | end 44 | end 45 | end 46 | end) 47 | -------------------------------------------------------------------------------- /Create food.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Create food 3 | Description: Cast food creation spell when no food inside bp. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local FOODS = {3725, 3607} -- ids of food to check 8 | local CREATE_WHEN_AMOUNT = 1 -- cast spell when amount of food <= this amount 9 | local SPELL = {name = "exevo pan", mana = 40} -- spell to create food 10 | 11 | -- DON'T EDIT BELOW THIS LINE 12 | 13 | ---------------------------------------------------------------------------------------------------------------------------------------------------------- 14 | --> Function: isFood() 15 | --> Description: Check for food in containers 16 | --> Params: None 17 | 18 | --> Return: number food quantity. 19 | ---------------------------------------------------------------------------------------------------------------------------------------------------------- 20 | function isFood() 21 | local items, amount = Container.getItems(), 0 22 | for i, cont in pairs(items) do 23 | local contItems = cont.items 24 | for j, item in pairs(contItems) do 25 | if table.find(FOODS, item.id) then 26 | amount = amount + item.count 27 | end 28 | end 29 | end 30 | return amount 31 | end 32 | 33 | -- module run in loop 34 | Module.New("Create food", function (mod) 35 | if Self.isConnected() then 36 | if isFood() <= CREATE_WHEN_AMOUNT then 37 | Self.CastSpell(SPELL.name, SPELL.mana, 2000) 38 | end 39 | end 40 | mod:Delay(1000, 1500) 41 | end) 42 | -------------------------------------------------------------------------------- /Logout and relogin every time.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Logout and relogin every time 3 | Description: When no pz logout for x minutes then relogin, kill monsters(attack from bot panel) 4 | Author: Ascer - example 5 | ]] 6 | 7 | local TIME_BEEING_LOGGED_OUT = 5 -- minutes under disconnected condition. 8 | local TIME_BEEING_LOGGED = 1 -- minutes we stay online. Minimal time to logout if no pz 9 | 10 | 11 | -- DONT EDIT BELOW THIS LINE 12 | 13 | local logoutTime, stayTime = os.time(), os.time() 14 | 15 | Module.New("Logout and relogin every time", function (mod) 16 | 17 | -- when connected. 18 | if Self.isConnected() then 19 | 20 | -- when no pz 21 | if not Self.isInFight() and os.time() - stayTime >= (60 * TIME_BEEING_LOGGED) then 22 | 23 | -- logout action 24 | Self.Logout() 25 | 26 | -- set logout time. 27 | logoutTime = os.time() 28 | 29 | end 30 | 31 | else 32 | 33 | -- when time is ok login 34 | if os.time() - logoutTime >= (60 * TIME_BEEING_LOGGED_OUT) then 35 | 36 | -- login to game standard option sending key enter, for classicTibia use func: classicTibiaRelogin() 37 | Rifbot.PressKey(13, 3000) 38 | 39 | -- update time 40 | stayTime = os.time() 41 | 42 | end 43 | 44 | end 45 | 46 | -- module execution delay in ms. 47 | mod:Delay(1000, 2500) 48 | 49 | end) -------------------------------------------------------------------------------- /Logout for while on default message.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Logout for while on default message 3 | Description: Respond for message on chat 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | keywords = {"log", "logout"}, -- react only fot this messages on default 9 | sender = "Character Name", -- accept message only from this player name (capita) 10 | relogin_after = 5 -- relogin to game after 5 seconds 11 | } 12 | 13 | -- DON'T EDIT BELOW 14 | 15 | config.keywords = table.lower(config.keywords) 16 | 17 | local logout, logTime = false, 0 18 | 19 | function proxy(messages) 20 | for i, msg in ipairs(messages) do 21 | if string.lower(msg.speaker) == string.lower(config.sender) then 22 | if table.find(config.keywords, string.lower(msg.message)) then 23 | Self.Logout() 24 | logout = true 25 | end 26 | end 27 | end 28 | end 29 | Proxy.New("proxy") 30 | 31 | Module.New("Logout for while on default message", function() 32 | if Self.isConnected() then 33 | if logout then 34 | Self.Logout() 35 | end 36 | else 37 | if logout then 38 | logTime = os.clock() 39 | logout = false 40 | else 41 | if os.clock() - logTime > config.relogin_after then 42 | Rifbot.PressKey(13, 2000) 43 | end 44 | end 45 | end 46 | end) -------------------------------------------------------------------------------- /Wear Life Ring if Low Health.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Wear Life Ring if Low Health 3 | Description: Equip Life ring when health % below value else dequip. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local HEALTH_PERC = {on = 50, off = 90} -- wear ring when hpperc is below (ON value) and dequip when will be above (OFF value) 8 | local LIFE_RING = {on = 3089, off = 3052} -- set id for life ring on - equiped, off - not 9 | 10 | -- DONT EDIT BELOW THIS LINE 11 | 12 | Module.New("Wear Life Ring if Low Health", function () 13 | 14 | -- when connected to game 15 | if Self.isConnected() then 16 | 17 | -- load ring and hpperc 18 | local hpperc = Self.HealthPercent() 19 | local ring = Self.Ring() 20 | 21 | -- when low health 22 | if hpperc <= HEALTH_PERC.on then 23 | 24 | -- when our slot.ring.id is different than life_ring.on 25 | if Self.Ring().id ~= LIFE_RING.on then 26 | 27 | -- equip ring 0 delay. 28 | Self.EquipItem(SLOT_RING, LIFE_RING.off, 1, 0) 29 | 30 | end 31 | 32 | -- when hpperc is above max value. 33 | elseif hpperc >= HEALTH_PERC.off then 34 | 35 | -- when our slot.ring.id is this same as life ring on 36 | if Self.Ring().id == LIFE_RING.on then 37 | 38 | -- dequip ring. 39 | Self.DequipItem(SLOT_RING) 40 | 41 | end 42 | 43 | end 44 | 45 | end 46 | 47 | end) 48 | -------------------------------------------------------------------------------- /Haste If No Monsters.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Haste If No Monsters 3 | Description: Cast haste spell when no monsters on screen. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SPELL = "utani hur" -- spell to cast 8 | local IGNORE_MOBS = {"rat", "snake", "rabbit"} -- ignore checking this monsters. 9 | 10 | -- DON'T EDIT BELOW THIS LINE 11 | 12 | IGNORE_MOBS = table.lower(IGNORE_MOBS) 13 | 14 | ---------------------------------------------------------------------------------------------------------------------------------------------------------- 15 | --> Function: getMonsters() 16 | --> Description: Read creatures for monsters on screen. 17 | --> Class: None 18 | --> Params: None 19 | --> Return: boolean true or false 20 | ---------------------------------------------------------------------------------------------------------------------------------------------------------- 21 | function getMonsters() 22 | for i, mob in pairs(Creature.iMonsters(7, false)) do 23 | if not table.find(IGNORE_MOBS, string.lower(mob.name)) then 24 | return true 25 | end 26 | end 27 | return false 28 | end 29 | 30 | -- loop module. 31 | Module.New("Haste If No Monsters", function (mod) 32 | 33 | -- when no hasted. 34 | if not Self.isHasted() then 35 | 36 | -- when no monsters. 37 | if not getMonsters() then 38 | 39 | -- cast spell, mana, delay. 40 | Self.CastSpell(SPELL, 40, 500) 41 | 42 | end 43 | 44 | end 45 | 46 | -- module delay in miliseconds 47 | mod:Delay(200, 400) 48 | 49 | end) 50 | -------------------------------------------------------------------------------- /Pause Bot on Dmg Health Calc.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Pause Bot on DMG Health Calc 3 | Description: Stop bot when you get DMG % and no monsters on screen. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local CHECK_FOR_HEALTH_DMG = { 8 | percent = 10, -- minimal hpperc decreased by GM. 9 | pauseLua = false -- true/false pause lua scripts too 10 | } 11 | 12 | local lastHealth, isDMG = Self.Health(), false 13 | 14 | function checkForHealthDmg() 15 | local hp = Self.Health() 16 | if hp < lastHealth then 17 | local dmg = lastHealth - hp 18 | dmg = math.floor((dmg / Self.HealthMax()) * 100) 19 | if dmg >= CHECK_FOR_HEALTH_DMG.percent then 20 | Rifbot.PlaySound("Default.mp3") 21 | local pauseLuaScripts = false 22 | if CHECK_FOR_HEALTH_DMG.pauseLua then 23 | pauseLuaScripts = true 24 | end 25 | Rifbot.setEnabled(false, pauseLuaScripts) 26 | isDMG = true 27 | print("Health dmg over " .. dmg .. "%") 28 | end 29 | end 30 | lastHealth = hp 31 | end 32 | 33 | Module.New("Pause Bot on DMG Health Calc", function () 34 | if Self.isConnected() then 35 | if isDMG then 36 | Rifbot.PlaySound("Default.mp3") 37 | end 38 | local mobs = Creature.iMonsters(7) 39 | if table.count(mobs) <= 0 then 40 | checkForHealthDmg() 41 | end 42 | end 43 | end) -------------------------------------------------------------------------------- /Out of stones - pickup.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Out of stones - pickup 3 | Description: Pickup small stones to hand only if this inventory slot is empty. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SMALL_STONE = 1781 -- id of small stone/ spear 3277 8 | local HAND = "left" -- where to pickup stones "left" or "right" monitor side 9 | 10 | -- DON'T EDIT BELOW 11 | 12 | Module.New("Out of stones - pickup", function (mod) 13 | 14 | -- if we are connected 15 | if Self.isConnected() then 16 | 17 | -- set hand to slot weapon "left" monitor side 18 | local hand = SLOT_WEAPON 19 | 20 | -- set new hand if need 21 | if string.lower(HAND) == "right" then 22 | hand = SLOT_SHIELD 23 | end 24 | 25 | -- only if hand slot is empty 26 | if selfGetEquipmentSlot(hand).id == 0 then 27 | 28 | -- load position 29 | local pos = Self.Position() 30 | 31 | -- search stones on 1 sqm range 32 | for x = -1, 1 do 33 | 34 | for y = -1, 1 do 35 | 36 | -- load map item 37 | local item = Map.GetTopMoveItem(pos.x+x, pos.y+y, pos.z) 38 | 39 | -- if id is equal to id small stone 40 | if item.id == SMALL_STONE then 41 | 42 | -- Pickup item 43 | Self.EquipItemFromGround(hand, pos.x+x, pos.y+y, pos.z, item.id, item.count, 1000) 44 | 45 | -- end loop 46 | break 47 | 48 | end 49 | 50 | end 51 | 52 | end 53 | 54 | end 55 | 56 | end 57 | 58 | -- execution module delay in ms 59 | mod:Delay(1000) 60 | 61 | end) 62 | -------------------------------------------------------------------------------- /Uh healing + Exori con.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Uh healing + Exori con 3 | Description: Restore health using uh rune conditional on mana and use exori con only when hp not low. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local UH = { 8 | hpperc = 50, --> use only if hpperc is below this value 9 | mana = 50, --> use if mana is below this value. Type 999999 if you want ignore mana 10 | id = 3160, --> what rune to use 11 | delay = 1000 --> use every miliseconds 12 | } 13 | 14 | local SPELL = { 15 | hpperc = 70, --> use only if hpperc is above this value 16 | mana = 50, --> use only if mana is above this value 17 | name = "exori con", --> spell name to cast 18 | delay = 2000 --> execution delay in miliseconds 1000ms = 1s 19 | } 20 | 21 | -- DONT'T EDIT BELOW THIS LINE 22 | 23 | Module.New("Uh healing + Exori con", function () 24 | 25 | -- load hpperc and mana 26 | local hp = Self.HealthPercent() 27 | local mp = Self.Mana() 28 | 29 | -- when conditions is meet requirements 30 | if hp <= UH.hpperc and mp <= UH.mana then 31 | 32 | -- use rune with character. 33 | Self.UseItemWithMe(UH.id, UH.delay) 34 | 35 | else 36 | 37 | -- when we have target. 38 | if Self.TargetID() > 0 then 39 | 40 | -- when conditions is meet requirements 41 | if hp >= SPELL.hpperc and mp >= SPELL.mana then 42 | 43 | -- cast spell 44 | Self.CastSpell(SPELL.name, SPELL.mana, SPELL.delay) 45 | 46 | end 47 | 48 | end 49 | 50 | end 51 | 52 | end) -------------------------------------------------------------------------------- /Use Ground Around You.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Use Ground Around You 3 | Description: Character will use map item around you 1sqm. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local OPEN_DELAY = 200 -- use ground every 200 miliseconds (default) 8 | local CROPSE_IDS = {3994, 5964, 4173} -- enter here ids of dead monsters to open. 9 | 10 | 11 | -- DONT'T EDIT BELOW THIS LINE 12 | 13 | local lastPos = Self.Position() 14 | local tablePos = {{-1, -1}, {-1, 0}, {-1, 1}, {1, -1}, {1, 0}, {1, 1}, {0, 1}, {0, -1}} 15 | local offset = 1 16 | 17 | 18 | -- run function in loop here 19 | Module.New("Use Ground Around You", function (mod) 20 | 21 | -- load pos 22 | local pos = Self.Position() 23 | 24 | -- when current pos is diff than last pos reset offset 25 | if pos.x ~= lastPos.x or pos.y ~= lastPos.y or pos.z ~= lastPos.z then 26 | 27 | -- rest offset 28 | offset = 1 29 | 30 | end 31 | 32 | -- load map 33 | local map = Map.GetTopMoveItem(pos.x + tablePos[offset][1], pos.y + tablePos[offset][2], pos.z) 34 | 35 | -- set last pos 36 | lastPos = Self.Position() 37 | 38 | if table.find(CROPSE_IDS, map.id) then 39 | 40 | -- Use map. 41 | Map.UseItem(pos.x + tablePos[offset][1], pos.y + tablePos[offset][2], pos.z, map.id, 1, 0) 42 | 43 | end 44 | 45 | 46 | -- add offset 47 | offset = offset + 1 48 | 49 | -- when offset is equal or higher than 9 reset 50 | if offset >= 9 then 51 | 52 | offset = 1 53 | 54 | end 55 | 56 | -- set module delay. 57 | mod:Delay(OPEN_DELAY) 58 | 59 | end) 60 | -------------------------------------------------------------------------------- /Drink fluids from dead monsters.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Drink fluids from dead monsters 3 | Description: Just if you drop fluid from monster character will use it with yourself. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | id = 2874, -- id of fluid 9 | cropse = {"The", "Demonic", "Dead", "Slain", "Dissolved", "Remains", "Elemental", "Split"}, -- names od dead cropses, add your if list no contains enough 10 | dontDrinkIfYourHppercBelow = 50 -- if your character hpperc will below don't drink fuild (maybe you need UH) 11 | } 12 | 13 | function getCropse(name) 14 | for _, element in ipairs(table.lower(config.cropse)) do 15 | if string.lower(name):find(element) then 16 | return true 17 | end 18 | end 19 | return false 20 | end --> check if cropse name is valid 21 | 22 | Module.New("Drink fluids from dead monsters", function() 23 | if Self.isConnected() then 24 | local containers = Container.getItems() 25 | for i, container in ipairs(containers) do 26 | local contInfo = Container.getInfo(container.index) 27 | if getCropse(contInfo.name) then 28 | local items = container.items 29 | for j, item in ipairs(items) do 30 | if item.id == config.id and item.count ~= 0 then 31 | if Self.HealthPercent() >= config.dontDrinkIfYourHppercBelow then 32 | local pos = Self.Position() 33 | return Container.UseItemWithGround(container.index, (j-1), item.id, pos.x, pos.y, pos.z, 1000) 34 | end 35 | end 36 | end 37 | end 38 | end 39 | end 40 | end) -------------------------------------------------------------------------------- /Alert if item count.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Alert if item count 3 | Description: Play sound your character if item count is below/above x value. 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | local config = { 9 | {id = 3031, count = 2, mod = "below"}, -- id = item id to check, count = amount of items, mod = we check for "above" or "below" count value 10 | --{id = 3031, count = 2, mod = "above"}, 11 | } 12 | 13 | -- DON'T EDIT BELOW THIS LINE. 14 | 15 | function equipmentItemCount(id) 16 | local amount = 0 17 | for i = 0, 9 do 18 | local item = selfGetEquipmentSlot(i) 19 | if id == item.id then 20 | if item.id == MANA_FLUID.id and MANA_FLUID.type == 0 then 21 | if item.count == MANA_FLUID.count then 22 | amount = amount + 1 23 | end 24 | else 25 | amount = amount + item.count 26 | end 27 | end 28 | end 29 | return amount 30 | end --> get count of items in equipment by id. 31 | 32 | -- Module to run functions in loop 200ms. 33 | Module.New("Alert if item count", function () 34 | if Self.isConnected() then 35 | for _, item in ipairs(config) do 36 | local amount = Self.ItemCount(item.id) + equipmentItemCount(item.id) 37 | local var = amount <= item.count 38 | if item.mod == "above" then 39 | var = amount >= item.count 40 | end 41 | if var then 42 | Rifbot.PlaySound("Default.mp3") 43 | print("Item id: " .. item.id .. " is " .. item.mod .. " " .. item.count) 44 | end 45 | end 46 | end 47 | end) 48 | 49 | -------------------------------------------------------------------------------- /Destroy Furniture.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Destroy Furniture 3 | Description: Search for ids of furniture around you and use machete on it. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local FURNITURE_IDS = {2982, 2472, 2524, 2319, 2358, 3504} -- list of items to destroy 8 | local MACHETE_ID = 3308 -- id of weapon or machete to destroy. 9 | local RANGE = 1 -- distance between you and furniture 10 | local ALERT = false -- true/false play sound if item detect. 11 | 12 | -- DON'T EDIT BELOW 13 | 14 | Module.New("Destroy Furniture", function (mod) 15 | 16 | if Self.isConnected() then 17 | 18 | local furnitures = {} 19 | local pos = Self.Position() 20 | 21 | -- get all possible furnitures in range. 22 | for x = -RANGE, RANGE do 23 | for y = -RANGE, RANGE do 24 | local item = Map.GetTopMoveItem(pos.x+x, pos.y+y, pos.z) 25 | if table.find(FURNITURE_IDS, item.id) then 26 | table.insert(furnitures, {x = pos.x+x, y = pos.y+y, z = pos.z, id = item.id}) 27 | end 28 | end 29 | end 30 | 31 | local object, lastDist = -1, 10 32 | 33 | -- get the closetst furniture 34 | for i, furniture in ipairs(furnitures) do 35 | local dist = Self.DistanceFromPosition(furniture.x, furniture.y, furniture.z) 36 | if dist < lastDist then 37 | object = furniture 38 | lastDist = dist 39 | end 40 | end 41 | 42 | -- destroy item 43 | if object ~= -1 then 44 | if ALERT then 45 | Rifbot.PlaySound() 46 | end 47 | Self.UseItemWithGround(MACHETE_ID, object.x, object.y, object.z, math.random(1000, 1500)) 48 | end 49 | 50 | end 51 | end) 52 | -------------------------------------------------------------------------------- /Player attack go to label.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Player attack go to label 3 | Description: When player attack you go to label in walker. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | label = "safe place", -- label name we go when player attack us. 9 | canReadCheckAgainForMins = 10 -- how many minutes to enable re-checking for player attacking when we already go to label. 10 | } 11 | 12 | -- DONT EDIT BELOW THIS LINE. 13 | 14 | local changedLabel, changeTime = false, 0 15 | 16 | 17 | -- module to run function 18 | Module.New("Player attack go to label", function () 19 | 20 | -- when label is set. 21 | if changedLabel then 22 | 23 | -- when time diff is good 24 | if os.clock() - changeTime > (config.canReadCheckAgainForMins * 60) then 25 | 26 | -- reset param. 27 | changedLabel = false 28 | 29 | end 30 | 31 | end 32 | 33 | -- when we are connected 34 | if Self.isConnected() then 35 | 36 | -- in loop for creatures. 37 | for i, player in ipairs(Creature.iPlayers(7, false)) do 38 | 39 | -- when player attack. 40 | if player.attack > 0 then 41 | 42 | -- show message 43 | print(player.name .. " attacked you!") 44 | 45 | -- when we don't changed label then 46 | if not changedLabel then 47 | 48 | -- go to label 49 | Walker.Goto(config.label) 50 | 51 | -- set. 52 | changedLabel = true 53 | changeTime = os.clock() 54 | 55 | end 56 | 57 | -- destroy lop 58 | break 59 | 60 | end 61 | 62 | end 63 | 64 | end 65 | 66 | end) 67 | -------------------------------------------------------------------------------- /Switch Ering.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Switch Ering 3 | Description: Equip energy ring when when hpperc <= 75% with possiblity to off when high hpperc value. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local ENERGY_RING = {on = 3088, off = 3051} -- set id for ering on - equiped, off - not 8 | local HPPERC = 75 -- when hpperc below or equal rquip ring else dequip 9 | local ONLY_WHEN_NO_PLAYERS_ON_SCREEN = false -- true/false will ering when low hp but also when no players on screen. 10 | local DEQUIP_ONLY_WHEN_HPPERC_ABOVE = {enabled = false, hpperc = 95} -- true/false dequip e ring only when hpperc will above value. 11 | 12 | function getPlayers() 13 | for _, player in ipairs(Creature.iPlayers(7, false)) do 14 | return 1 15 | end 16 | return 0 17 | end 18 | 19 | Module.New("Switch Ering", function (mod) 20 | local hp = Self.HealthPercent() 21 | local ring = Self.Ring() 22 | local players = 0 23 | if hp <= HPPERC then 24 | if ONLY_WHEN_NO_PLAYERS_ON_SCREEN then 25 | players = getPlayers() 26 | end 27 | if players > 0 then return end 28 | if ring.id ~= ENERGY_RING.on then 29 | Self.EquipItem(SLOT_RING, ENERGY_RING.off, 1) 30 | end 31 | else 32 | if ring.id == ENERGY_RING.on and (not DEQUIP_ONLY_WHEN_HPPERC_ABOVE.enabled or (DEQUIP_ONLY_WHEN_HPPERC_ABOVE.enabled and hp >= DEQUIP_ONLY_WHEN_HPPERC_ABOVE.hpperc)) then 33 | Self.DequipItem(SLOT_RING) -- dequip ring 34 | end 35 | end 36 | mod:Delay(200, 700) 37 | end) 38 | -------------------------------------------------------------------------------- /Wait For Spawn.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Wait For Spawn 3 | Description: Logout when spawn is empty and login after x time. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SPAWN_MONSTERS = {"rotworm", "troll", "rat"} -- monsters separated by comma we looking. 8 | local SPAWN_RANGE = 7 -- max distane between you and monster default 7 = on screen 9 | local SPAWN_WAIT = 10 -- wait 10 min for spawn (not sure if 10min is enought need to test) 10 | 11 | -- DON'T EDIT BELOW THIS LINE 12 | 13 | local logoutTime 14 | 15 | Module.New("Wait For Spawn", function (mod) 16 | if Self.isConnected() then 17 | local count = 0 18 | local monsters = table.lower(SPAWN_MONSTERS) -- case lower all table with mosters 19 | for i, mob in pairs(Creature.iMonsters(SPAWN_RANGE, false)) do 20 | if table.find(monsters, string.lower(mob.name)) then 21 | count = count + 1 22 | break -- break loop we don't need more here. 23 | end 24 | end 25 | if count == 0 then -- do action only when no monsters 26 | if not Self.isInFight() then 27 | logoutTime = os.clock() 28 | Self.Logout() 29 | wait(500, 1800) 30 | end 31 | end 32 | else 33 | printf("Successfully logout due a no monsters. Relogin for " .. math.floor((SPAWN_WAIT * 60) - (os.clock() - logoutTime)) .. "s." ) 34 | wait(800, 1200) 35 | if os.clock() - logoutTime > (60 * SPAWN_WAIT) then 36 | Rifbot.PressKey(13) -- press enter key 37 | end 38 | end 39 | mod:Delay(1500, 3000) 40 | end) -------------------------------------------------------------------------------- /Charge Weapon with Crystal.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Charge Weapon with Crystal 3 | Description: Use crystals on weapon slot every 120min 4 | Author: Ascer - example 5 | ]] 6 | 7 | local TIME = 120 -- time in minutes to restore charge 8 | local CRYSTALS = {8593, 8540} -- group of crystals to use {use once, use second, ..} if you want charge x2 with this same id use: {id, id} 9 | 10 | -- DONT'T EDIT BELOW THIS LINE 11 | 12 | local startTime = -99999999 13 | 14 | Module.New("Charge Weapon with Crystal", function () 15 | 16 | -- when connected to game 17 | if Self.isConnected() then 18 | 19 | -- when time diff is valid. 20 | if os.clock() - startTime > (TIME * 60) then 21 | 22 | -- inside loop for crystal 23 | for i = 1, #CRYSTALS do 24 | 25 | -- find crystal item. 26 | local item = Container.FindItem(CRYSTALS[i], nil) 27 | 28 | -- when item has found. 29 | if item ~= false then 30 | 31 | -- load weapon id 32 | local weapon = Self.Weapon() 33 | 34 | -- use crystal on weapon slot. 35 | Container.UseItemWithEquipment(item.index, item.slot, item.id, SLOT_WEAPON, weapon.id, 0) 36 | 37 | -- wait some time 38 | wait(1000, 1500) 39 | 40 | -- update time 41 | startTime = os.clock() 42 | 43 | end 44 | 45 | end 46 | 47 | end 48 | 49 | end 50 | 51 | end) -------------------------------------------------------------------------------- /Stop cavebot and logout if no mf.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Stop cavebot and logout if no mf 3 | Description: This script will check for green message about using vials. If low amount then will stop cavebot and wait for lost pz to logout. 4 | Required: Gameclient need to send green message about vials. 5 | Author: Ascer - example 6 | ]] 7 | 8 | local config = { 9 | vialMsg = "Using one of (.+) vials...", -- msg about vials, (.+) -> is place for detecting vials number 10 | amount = 10 -- when mfs below this amount do action. 11 | } 12 | 13 | -- DON'T EDIT BELOW THIS LINE 14 | local currentVials, logout = -1, false 15 | 16 | --> read special messages in game 17 | function proxyText(messages) 18 | for i, msg in ipairs(messages) do 19 | local vials = string.match(msg.message, config.vialMsg) 20 | if vials ~= nil then 21 | currentVials = tonumber(vials) 22 | end 23 | end 24 | end 25 | Proxy.TextNew("proxyText") 26 | 27 | Module.New("Stop cavebot and logout if no mf", function() 28 | if Self.isConnected() then 29 | if logout then 30 | if Walker.isEnabled() then Walker.Enabled(false) end 31 | if Looter.isEnabled() then Looter.Enabled(false) end 32 | if not Self.isInFight() then 33 | Self.Logout() 34 | else 35 | print("Waiting for pz lost to logout..") 36 | end 37 | end 38 | if currentVials ~= -1 and currentVials <= config.amount then 39 | logout = true 40 | end 41 | else 42 | if logout then 43 | Rifbot.setCheckboxState("runemaker", "relogin after", false) -- disable here relogin from runemaker 44 | end 45 | end 46 | end) 47 | -------------------------------------------------------------------------------- /Open Next Bp when full.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Open Next Bp when full 3 | Description: Open next backpack in specific container when all slots taken. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local BACKPACKS = { 8 | {index = 0, id = 2854}, -- container index 0 = first opened container, id - backpack id to open. 9 | {index = 1, id = 2854} 10 | -- you can add more here 11 | } 12 | 13 | -- DONT EDIT BELOW THIS LINE 14 | 15 | -- loop module 16 | Module.New("Open Next Bp when full", function (mod) 17 | 18 | -- when connected. 19 | if Self.isConnected() then 20 | 21 | -- inside loop 22 | for i, bp in ipairs(BACKPACKS) do 23 | 24 | -- load container with index: BACKPACK.index 25 | local cont = Container.getInfo(bp.index) 26 | 27 | -- when amount of items in table is above 0 28 | if table.count(cont) > 0 then 29 | 30 | -- when amount of items == size of cont. 31 | if cont.amount == cont.size then 32 | 33 | -- searach for next backpack to open. 34 | local item = Container.FindItem(bp.id, bp.index) 35 | 36 | -- if found 37 | if item ~= false then 38 | 39 | -- open backpack 40 | Container.UseItem(item.index, item.slot, item.id, false, 1000) 41 | 42 | end 43 | 44 | end 45 | 46 | end 47 | 48 | end 49 | 50 | end 51 | 52 | -- delay between actions in miliseconds 53 | mod:Delay(200, 500) 54 | 55 | end) 56 | -------------------------------------------------------------------------------- /Convert chests to monsters.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Convert chests to monsters 3 | Description: When you found specific ids of chest on map {15x11 sqms only} then click them. Will ignore action if you targeting some creature 4 | Author: Ascer - example 5 | ]] 6 | 7 | local CHESTS = {3031, 3492, 3160} -- IDs of chest on map area 8 | local DISABLE_WALKER = true -- true/false disale walker when chest found 9 | local CLICK_ONLY_IF_NO_MONSTERS = true -- true/false click check only in no monsters in range 5sqm 10 | 11 | -- DON'T EDIT BELOW 12 | 13 | Module.New("Convert chests to monsters", function () 14 | if Self.isConnected() and Self.TargetID() <= 0 then 15 | local pos = Self.Position() 16 | if CLICK_ONLY_IF_NO_MONSTERS then 17 | if table.count(Creature.iMonsters(5, false)) > 0 then 18 | return 19 | end 20 | end 21 | for x = -7, 7 do 22 | for y = -5 , 5 do 23 | local map = Map.GetTopMoveItem(pos.x + x, pos.y + y, pos.z) 24 | if table.find(CHESTS, map.id) then 25 | if DISABLE_WALKER then 26 | if Walker.isEnabled() then Walker.Enabled(false) end 27 | end 28 | return Map.UseItem(pos.x + x, pos.y + y, pos.z, map.id, 1, 2000) -- use chests with 2 s delay 29 | end 30 | end 31 | end 32 | if DISABLE_WALKER then 33 | if not Walker.isEnabled() then Walker.Enabled(true) end 34 | end 35 | end 36 | mod:Delay(500) 37 | end) 38 | -------------------------------------------------------------------------------- /UH + IH healing + mana rune.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: UH + IH healing + mana rune 3 | Description: Heal yourself with uhs, ihs and manarunes 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | local config = { 9 | light = {hpperc = 90, itemid = 3152}, -- light healing with IH (Intense Healing Rune) when hpperc <= 90% and above 70% 10 | heavy = {hpperc = 70, itemid = 3160}, -- heavy healing when UH (Ultimate Healing Rune) hpperc < 70 % 11 | mana = {mpperc = 70, itemid = 3157}, -- heal mana when hp is > 90% and mana below 70% 12 | delay = 1000 -- delay to use rune 1000ms 13 | } 14 | 15 | -- DON'T EDIT BELOW THIS LINE 16 | 17 | local castTime = 0 18 | 19 | 20 | function useOnMe(id) 21 | if os.clock() - castTime < (config.delay/1000) then return false end 22 | Self.UseItemWithMe(id, 0) 23 | castTime = os.clock() 24 | end 25 | 26 | 27 | Module.New("UH + IH healing + mana rune", function () 28 | 29 | -- when connected. 30 | if Self.isConnected() then 31 | 32 | -- load hp, mama 33 | local mpperc = Self.ManaPercent() 34 | local hpperc = Self.HealthPercent() 35 | 36 | -- when low heal. 37 | if hpperc < config.heavy.hpperc then 38 | 39 | -- use heavy rune 40 | useOnMe(config.heavy.itemid) 41 | 42 | else 43 | 44 | -- when hpperc is below light 45 | if hpperc < config.light.hpperc then 46 | 47 | -- use light rune 48 | useOnMe(config.light.itemid) 49 | 50 | else 51 | 52 | -- when mana is below 53 | if mpperc < config.mana.mpperc then 54 | 55 | -- use mana rune 56 | useOnMe(config.mana.itemid) 57 | 58 | end 59 | 60 | end 61 | 62 | end 63 | 64 | end 65 | 66 | end) 67 | -------------------------------------------------------------------------------- /Eat From Ground.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Eat From Ground 3 | Description: Eat food in from specific x, y, z location. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local MAIN_DELAY = {4, 9} -- mintues between run function. 8 | local USE_DELAY = {200, 650} -- miliseconds between use action. 9 | local USE_TRIES = {4, 7} -- amount of times to use . 10 | local HOUSE_DOOR = {32360, 32206, 6}-- position of food in house. 11 | 12 | local FOOD_ID = 3582 -- food id 13 | 14 | -- DONT'T EDIT BELOW THIS LINE 15 | 16 | local mainTime, useTime, mainDelay, useDelay, tries, useTries = 0, 0, 0, 0, 0, 0 17 | 18 | -- mod to run functions 19 | Module.New("Eat Food", function (mod) 20 | if (os.clock() - mainTime) >= mainDelay then -- check for main func time 21 | if useTries <= 0 then 22 | useTries = math.random(USE_TRIES[1], USE_TRIES[2]) -- set random tries 23 | else 24 | if (os.clock() - useTime) >= useDelay and Self.isConnected() then -- check for time and connection 25 | Map.UseItem(HOUSE_DOOR[1], HOUSE_DOOR[2], HOUSE_DOOR[3], FOOD_ID, 1, 0) -- using item on stack nr 1 26 | useTime = os.clock() 27 | useDelay = math.random(USE_DELAY[1], USE_DELAY[2])/1000 28 | tries = tries + 1 29 | if tries >= useTries then 30 | tries = 0 31 | useTries = 0 32 | mainTime = os.clock() 33 | mainDelay = math.random(MAIN_DELAY[1] * 60, MAIN_DELAY[2] * 60) 34 | end 35 | end 36 | end 37 | end 38 | mod:Delay(200, 350) 39 | end) 40 | -------------------------------------------------------------------------------- /Runelast when target lost.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Runelast when target lost 3 | Description: Shoot rune with last targetID no matter is visible or not when receivied proxy message "Target lost" 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | runeid = 3155, -- id of rune to shoot 9 | offTargetingForWhile = true, -- off targeting for while to don't lost stored last attacked monster ID. 10 | waitBeforeShoot = 1000 -- delay in miliseconds character wait after monster became invisible to shoot rune, 11 | } 12 | 13 | -- DON'T EDIT BELOW THIS LINE 14 | 15 | local shootRune, lastTarget, lastCreature = false, -1, -1 16 | 17 | Module.New("Runelast when target lost", function() 18 | if Self.isConnected() then 19 | if shootRune then 20 | if table.count(lastCreature) > 2 then 21 | wait(waitBeforeShoot) 22 | Self.UseItemWithCreature(lastCreature, config.runeid, 0) --> force shoot rune 0 delay 23 | end 24 | shootRune = false --> disable shooting after 1 tries 25 | if config.offTargetingForWhile then 26 | Targeting.Enabled(true) 27 | end 28 | end 29 | local t = Self.TargetID() 30 | if t > 0 then 31 | if t ~= lastTarget then 32 | lastTarget = t 33 | lastCreature = Creature.getCreatures(lastTarget) 34 | end 35 | end 36 | end 37 | end) --> Module to read last target id 38 | 39 | 40 | function proxyText(messages) 41 | for i, msg in ipairs(messages) do 42 | if msg.message == "Target lost." then 43 | shootRune = true 44 | if config.offTargetingForWhile then 45 | Targeting.Enabled(false) 46 | end 47 | end 48 | end 49 | end 50 | Proxy.TextNew("proxyText") --> Proxy func to set shootRune = true on message "Target lost." 51 | -------------------------------------------------------------------------------- /Auto Mana Shield if no Monsters.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Auto Mana Shield if no Monsters 3 | Description: When no utamo and no monsters cast mana shield spell 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SPELL = {name = "utamo vita", mana = 50, delay = 500} -- @name - spell to cast, @mana - min mana to use, @delay - cast every miliseconds. 8 | 9 | 10 | -- DON'T EDIT BELOW THIS LINE 11 | 12 | 13 | ---------------------------------------------------------------------------------------------------------------------------------------------------------- 14 | --> Function: getMobs() 15 | --> Description: Check for monsters on screen. 16 | --> Params: None 17 | --> 18 | --> Return: boolean true or false. 19 | ---------------------------------------------------------------------------------------------------------------------------------------------------------- 20 | function getMobs() 21 | 22 | -- in loop check for monsters on screnn. 23 | for i = 1, #Creature.iMonsters(7, false) do 24 | 25 | -- return true there is monster on screen 26 | return true 27 | 28 | end 29 | 30 | -- no monsters on screen 31 | return false 32 | 33 | end 34 | 35 | -- run in loop. 36 | Module.New("Auto Mana Shield if no Monsters", function () 37 | 38 | -- when connected. 39 | if Self.isConnected() then 40 | 41 | -- when no monsters 42 | if not getMobs() then 43 | 44 | -- when no mana shielded. 45 | if not Self.isManaShielded() then 46 | 47 | -- when mana fine. 48 | if Self.Mana() >= SPELL.mana then 49 | 50 | -- cast spell. 51 | Self.CastSpell(SPELL.name, SPELL.mana, SPELL.delay) 52 | 53 | end 54 | 55 | end 56 | 57 | end 58 | 59 | end 60 | 61 | end) 62 | -------------------------------------------------------------------------------- /Player On Screen + Skull Alarm.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Player On Screen + Skull Alarm 3 | Description: Play sound player is on screen. (configurable safe list, time required to player stay on screen, check only for skulls) 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SAFE_LIST = {"Friend1", "Friend2"} -- add here your training friend or defense monster for example. Names need to by with Capital letter. 8 | local MINIMAL_TIME_STAY_ON_SCREEN = 0 -- minimal amount of miliseconds (1000ms = 1s) player stay on screen to alert. For 5s put 5000 9 | local CHECK_ONLY_FOR_SKULLS = false -- true/false check only for players that have skull red or white 10 | local MULTIFLOOR = false -- true/false check for players above/below 11 | 12 | -- DON'T EDIT BELOW THIS LINE 13 | 14 | local enterTime = 0 15 | 16 | -- loop function 17 | Module.New("Player On Screen + Skull Alarm", function () 18 | local isPlayer = false 19 | for i, player in pairs(Creature.iPlayers(7, MULTIFLOOR)) do 20 | if not table.find(SAFE_LIST, player.name) and (not CHECK_ONLY_FOR_SKULLS or (CHECK_ONLY_FOR_SKULLS and player.skull >= SKULL_WHITE)) then 21 | isPlayer = true 22 | if enterTime <= 0 then 23 | enterTime = os.clock() 24 | end 25 | if enterTime > 0 then 26 | if os.clock() - enterTime >= (MINIMAL_TIME_STAY_ON_SCREEN / 1000) then 27 | playSound("Macro Test.wav") -- for more search in Rifbot Lib.lua -> RIFBOT_SOUNDS = [] 28 | break -- break loop 29 | end 30 | end 31 | end 32 | end 33 | if not isPlayer then enterTime = 0 end -- when no player reset time. 34 | end) 35 | -------------------------------------------------------------------------------- /Switch Life Ring and ROH.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Switch Life Ring and ROH 3 | Description: Equip ROH when low mana and when high mana Life Ring. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local LIFE_RING = {on = 3089, off = 3052} -- set id for life ring on - equiped, off - not 8 | local RING_OF_HEALING = {on = 3098, off = 3061} -- set id for ring of healing on - equiped, off - not 9 | local MANA = {on = 700, off = 1100} -- if mana below ON value equip roh and life ring when mana above OFF. 10 | 11 | -- DON'T EDIT BELOW THIS LINE 12 | 13 | Module.New("Switch Life Ring and ROH ", function () 14 | 15 | -- when connected 16 | if Self.isConnected() then 17 | 18 | -- load mana 19 | local mp = Self.Mana() 20 | 21 | -- when mana 22 | if mp <= MANA.on then 23 | 24 | -- when our slot.ring.id is different than RING_OF_HEALING.on 25 | if Self.Ring().id ~= RING_OF_HEALING.on then 26 | 27 | -- equip ring with 0 delay. 28 | Self.EquipItem(SLOT_RING, RING_OF_HEALING.off, 1, 0) 29 | 30 | end 31 | 32 | else 33 | 34 | -- load ring 35 | local ring = Self.Ring().id 36 | 37 | -- when mana is above off roh or no ring 38 | if mp > MANA.off or ring == 0 then 39 | 40 | -- when our slot.ring.id is different than life_ring.on 41 | if ring ~= LIFE_RING.on then 42 | 43 | -- equip ring 0 delay. 44 | Self.EquipItem(SLOT_RING, LIFE_RING.off, 1, 0) 45 | 46 | end 47 | 48 | end 49 | 50 | end 51 | 52 | end 53 | 54 | end) 55 | -------------------------------------------------------------------------------- /Heal with eating food.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Heal with eating food 3 | Description: On some servers eating food give extra health and mana so lets use it. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | health = {perc = 80, food = {35348, 36090, 36004}}, -- heal health, percent, possible food 9 | mana = {perc = 50, food = {123}}, -- heal mana, precent, possible food 10 | moduleDelay = {500, 1000}, -- execute module (script loop) in random times between this delay. 11 | eatDelay = 3000 -- delay on first usage to avoid instant eating 12 | } 13 | 14 | -- DON'T EDIT BELOW 15 | local useTime, eatTime = 0, 0 16 | 17 | -- mod 200ms 18 | Module.New("Heal with eating food", function(mod) 19 | if Self.isConnected() then 20 | if Self.HealthPercent() <= config.health.perc then 21 | if eatTime == 0 then eatTime = os.clock() end 22 | if os.clock() - useTime >= 1 and os.clock() - eatTime >= config.eatDelay/1000 then 23 | local item = Container.FindItem(config.health.food) 24 | if table.count(item) > 0 then 25 | Container.UseItem(item.index, item.slot, item.id, false, 0) 26 | useTime = os.clock() 27 | end 28 | end 29 | elseif Self.ManaPercent() <= config.mana.perc then 30 | if eatTime == 0 then eatTime = os.clock() end 31 | if os.clock() - useTime >= 1 and os.clock() - eatTime >= config.eatDelay/1000 then 32 | local item = Container.FindItem(config.mana.food) 33 | if table.count(item) > 0 then 34 | Container.UseItem(item.index, item.slot, item.id, false, 0) 35 | useTime = os.clock() 36 | end 37 | end 38 | else 39 | eatTime = 0 40 | end 41 | end 42 | mod:Delay(config.moduleDelay[1], config.moduleDelay[2]) 43 | end) 44 | -------------------------------------------------------------------------------- /Runelast if no target.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Runelast if no target 3 | Description: Shoot rune with last attacked monster if current targetID = 0. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local RUNEID = 3174 -- id of rune to shoot with last attacked ID 8 | local MAX_DIST_FROM_LAST_TARGET_POS = 10 -- maximal accepted amount of sqms on this same floor to shoot rune from last known target position 9 | local MAX_SHOOTING_ATTEMPTS = 8 -- max possible tries to shoot rune before ignore target. 10 | local DELAY = 2000 -- shot every this milisecond 11 | 12 | -- DON'T EDIT BELOW THIS LINE 13 | 14 | local lastCreature, tries, timeVal = {id = 0}, 0, 0 15 | 16 | Module.New("Runelast if no target", function() 17 | if Self.isConnected() then 18 | local t = Self.TargetID() 19 | if t > 0 then 20 | if lastCreature.id ~= t then 21 | local c = Creature.getCreatures(t) 22 | if table.count(c) > 2 and Creature.isMonster(c) then 23 | lastCreature = c 24 | tries = 0 25 | end 26 | end 27 | else 28 | if lastCreature.id > 0 and os.clock() - timeVal > DELAY/1000 then 29 | if Creature.DistanceFromSelf(lastCreature) <= MAX_DIST_FROM_LAST_TARGET_POS then 30 | Self.UseItemWithCreature(lastCreature, RUNEID) 31 | end 32 | tries = tries + 1 33 | timeVal = os.clock() 34 | if tries >= MAX_SHOOTING_ATTEMPTS then 35 | lastCreature = {id = 0} 36 | end 37 | end 38 | end 39 | end 40 | end) -------------------------------------------------------------------------------- /Create Enchanted Spears While Hunt.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Create Enchanted Spears While Hunt 3 | Description: When you hunting with example Royal Spears and mana is high wear spear and create enchanted spear then restore royals. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | mpperc = 90, -- when mana % is equal or above create enchanted spear. 9 | spell = "exeta con", -- spell to create enchanted spear. 10 | spear = 3277, -- id of basic spear 11 | attack_weapon = 7037 -- id of royal spear or other. 12 | } 13 | 14 | -- DON'T EDIT BELOW 15 | 16 | Module.New("Create Enchanted Spears While Hunt", function () 17 | 18 | -- when connected 19 | if Self.isConnected() then 20 | 21 | -- load slot weapon 22 | local weapon = Self.Weapon() 23 | 24 | -- when mana is above 25 | if Self.ManaPercent() >= config.mpperc then 26 | 27 | -- when we have spear inside slot 28 | if weapon.id == config.spear then 29 | 30 | -- cast spell 31 | Self.CastSpell(config.spell) 32 | 33 | else 34 | 35 | -- wear basic spear 36 | Self.EquipItem(SLOT_WEAPON, config.spear, 1, 300) 37 | 38 | end 39 | 40 | else 41 | 42 | -- when weapon is diff than attack weapon 43 | if weapon.id ~= attack_weapon then 44 | 45 | -- wear attack weapon with max possible quantity (this allow to wear whole slot amount of container) 46 | Self.EquipItem(SLOT_WEAPON, config.attack_weapon, 100, 300) 47 | 48 | end 49 | 50 | end 51 | 52 | end 53 | 54 | end) -------------------------------------------------------------------------------- /Transfer gold after ask for balance.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Transfer gold after ask for balance 3 | Description: When you will in bank and ask npc for balance then bot read proxy and get amount then transfer all to selected person. 4 | Author: Ascer - example 5 | ]] 6 | 7 | 8 | local npcName = "Suzy" --> name of NPC 9 | local transferPerson = "Character Name" --> name of person we transfer cash 10 | local speakNPC = false --> true/false speak in NPC chanel (possible on some servers) 11 | 12 | -- DON'T EDIT BELOW 13 | 14 | local balance, canTransfer = 0, false 15 | 16 | function proxy(messages) 17 | for i, msg in ipairs(messages) do 18 | if msg.speaker == npcName then 19 | balance = string.match(msg.message, "Your account balance is (.+) gold.") --> this message can be different depend on server and amount you have 20 | if balance ~= nil then 21 | balance = string.gsub(balance, ",", "") 22 | balance = tonumber(balance) 23 | if balance > 0 then 24 | canTransfer = true 25 | end 26 | end 27 | end 28 | end 29 | end 30 | Proxy.New("proxy") 31 | 32 | --> module to execute transfer action with wait imitation of Player. 33 | Module.New("Transfer gold after ask for balance", function() 34 | if canTransfer then 35 | if speakNPC then 36 | Self.SayNpc("transfer") 37 | wait(800) 38 | Self.SayNpc(balance) 39 | wait(800) 40 | Self.SayNpc(transferPerson) 41 | wait(500) 42 | Self.SayNpc("yes") 43 | else 44 | Self.Say("transfer") 45 | wait(800) 46 | Self.Say(balance) 47 | wait(800) 48 | Self.Say(transferPerson) 49 | wait(500) 50 | Self.Say("yes") 51 | end 52 | canTransfer = false 53 | balance = 0 54 | end 55 | end) 56 | -------------------------------------------------------------------------------- /Runemaker (blanks to hand).lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Runemaker 3 | Description: Making runes or cast spell in game. Checking for no blank runes. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local MAIN_DELAY = {400, 1700} -- delay in milisecond random actions 8 | local MANA_ABOVE = 105 -- MANA POINTS above this cast spell 9 | local SPELL = "adura vita" -- spell to cast 10 | local BLANKID = 3147 -- blank rune id. 11 | 12 | local NO_BLANKS = { -- when no blank runes: 13 | castSpell = true, -- cast spell: true/false 14 | spell = "exura", -- spell to cast 15 | logout = false -- logout true/false 16 | } 17 | 18 | -- DONT'T EDIT BELOW THIS LINE 19 | 20 | Module.New("Runemaker", function (mod) 21 | if Self.Mana() >= MANA_ABOVE then 22 | local proxy = Proxy.ErrorGetLastMessage() 23 | local weapon = Self.Weapon().id 24 | if (string.instr(proxy, "magic item to cast") or (weapon ~= BLANKID and table.count(Container.FindItem(BLANKID)) < 2)) then 25 | if NO_BLANKS.logout then 26 | Self.Logout() 27 | Rifbot.ConsoleWrite("[" .. os.date("%X") .. "] logged due a no more blank runes") -- set message to Rifbot Console. 28 | else 29 | if NO_BLANKS.castSpell then 30 | Self.CastSpell(NO_BLANKS.spell) 31 | end 32 | end 33 | Proxy.ErrorClearMessage() -- we need to clear message manually. 34 | elseif string.instr(proxy, "more objects in this container") then -- we checking if container is full 35 | Self.DequipItem(SLOT_WEAPON) -- dequip to any empty 36 | Proxy.ErrorClearMessage() 37 | else 38 | if weapon ~= BLANKID then 39 | Self.EquipItem(SLOT_WEAPON, BLANKID) 40 | else 41 | Self.CastSpell(SPELL) 42 | end 43 | end 44 | end 45 | mod:Delay(MAIN_DELAY[1], MAIN_DELAY[2]) -- set random delay 46 | end) 47 | -------------------------------------------------------------------------------- /Custom Reconnect.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Custom Reconnect 3 | Description: Reconnect to game using mouse and keyboard simulation. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local ENTER_GAME_POS = {x = 120, y = 500} -- position x, y of enter game button on game window 8 | 9 | 10 | ---------------------------------------------------------------------------------------------------------------------------------------------------------- 11 | --> Function: customReconnect(x, y) 12 | --> Description: Reconnect to game using mouse and keyboard simulation 13 | --> Class: Rifbot 14 | --> Params: 15 | --> @x - number position x to click Enter Game button. 16 | --> @y - number position y to click Enter Game button 17 | --> Return: boolean true or false. 18 | ---------------------------------------------------------------------------------------------------------------------------------------------------------- 19 | function customReconnect(x, y) 20 | 21 | if not Self.isConnected() then 22 | 23 | -- press key esc. 24 | Rifbot.PressKey(27) 25 | 26 | wait(1000) 27 | 28 | -- click mouse to enter game 29 | Rifbot.MouseClick(x, y) 30 | 31 | wait(1000) 32 | 33 | -- in loop use enters. 34 | for i = 1, 5 do 35 | 36 | -- press enter 37 | Rifbot.PressKey(13) 38 | 39 | -- wait rando time 40 | wait(2000, 3000) 41 | 42 | if Self.isConnected() then 43 | 44 | -- return true we successfuly reconnected. 45 | return true 46 | 47 | end 48 | 49 | end 50 | 51 | else 52 | 53 | -- return true we successfuly reconnected. 54 | return true 55 | 56 | end 57 | 58 | end 59 | 60 | 61 | 62 | Module.New("Custom Reconnect", function () 63 | 64 | customReconnect(ENTER_GAME_POS.x, ENTER_GAME_POS.y) 65 | 66 | end) 67 | -------------------------------------------------------------------------------- /Drink Big and Small Mana Fluid.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Drink Big and Small Mana Fluid 3 | Description: Restore your character mana using normal mana fluid if high % of mana and big mana fluid if low % of mana. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SMALL_MANA_FLUID = {mpperc = 70, id = 2006} -- ID of standard mana fluid 8 | local BIG_MANA_FULUID = {mpperc = 50, id = 5595} -- ID of big mana fluid 9 | local MIN_HEAL_PERCENT = {hpperc = 50, enabled = false} -- don't drink mana if hpperc is <= 50%, @enabled = true/false 10 | local ONLY_VISIBLE_FLUIDS = false -- true/false allow use small fluid even if low mana level when big fluid not found 11 | local DELAY = {1000, 1500} -- delay for fluid is default 1000ms we set a little bit higher. 12 | 13 | -- DONT'T EDIT BELOW THIS LINE 14 | 15 | local mainDelay, mainTime = 0, 0 16 | 17 | Module.New("Drink Big and Small Mana Fluid", function () 18 | if Self.isConnected() then 19 | local mpperc = Self.ManaPercent() 20 | local hpperc = Self.HealthPercent() 21 | if ((MIN_HEAL_PERCENT.enabled and hpperc > MIN_HEAL_PERCENT.hpperc) or not MIN_HEAL_PERCENT.enabled) then 22 | if mpperc <= BIG_MANA_FULUID.mpperc then 23 | if ONLY_VISIBLE_FLUIDS then 24 | local mf = Container.FindItem(BIG_MANA_FULUID.id) 25 | if table.count(mf) <= 0 then 26 | return Self.UseItemWithMe(SMALL_MANA_FLUID.id, math.random(DELAY[1], DELAY[2])) 27 | end 28 | end 29 | Self.UseItemWithMe(BIG_MANA_FULUID.id, math.random(DELAY[1], DELAY[2])) 30 | else 31 | if mpperc <= SMALL_MANA_FLUID.mpperc then 32 | Self.UseItemWithMe(SMALL_MANA_FLUID.id, math.random(DELAY[1], DELAY[2])) 33 | end 34 | end 35 | end 36 | end 37 | end) -------------------------------------------------------------------------------- /Dequip Boots of Haste if player.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Dequip Boots of Haste if player 3 | Description: If player on screen take off boh, else equip. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local BOOTS = 3079 -- id of soft boots 8 | local DEQUIP_CONTAINTER_INDEX = 0 -- dequip only to first container (0, 1 - second) to don't lost boots in dead monsters. 9 | local SAFE_LIST = {"Friend1", "Friend2"} -- add here friends to avoid. 10 | 11 | -- DON'T EDIT BELOW THIS LINE 12 | 13 | local friends = table.lower(SAFE_LIST) 14 | 15 | Module.New("Dequip Boots of Haste if player", function () 16 | if Self.isConnected() then 17 | local isPlayer = false 18 | for i, player in pairs(Creature.iPlayers(7)) do 19 | if not table.find(friends, player.name) then 20 | isPlayer = true 21 | end 22 | end 23 | if isPlayer then 24 | if Self.Feet().id == BOOTS then 25 | local contTo = Container.getInfo(DEQUIP_CONTAINTER_INDEX) 26 | if table.count(contTo) > 0 then 27 | if contTo.size == contTo.amount then 28 | print("Container index " .. DEQUIP_CONTAINTER_INDEX .. " is full.") 29 | else 30 | Self.DequipItem(SLOT_FEET, DEQUIP_CONTAINTER_INDEX, contTo.amount, 500) -- delay 0.5s 31 | end 32 | else 33 | print("Container index " .. DEQUIP_CONTAINTER_INDEX .. " is closed.") 34 | end 35 | end 36 | else 37 | if Self.Feet().id ~= BOOTS then 38 | Self.EquipItem(SLOT_FEET, BOOTS, 1, 500) 39 | end 40 | end 41 | end 42 | end) -------------------------------------------------------------------------------- /Conjure Arrows.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Conjure Arrows 3 | Description: Create Arrows with conditions meets. 4 | Author: Ascer - example 5 | ]] 6 | 7 | local SPELL = {name = "exevo con", mana = 400} -- name -> spell to cast, mana -> min mana to cast spell 8 | local ITEM = {id = 3447, amount = 100, cap = 50} -- id -> id of arrows, amount -> create only when below this amount, cap -> dont create when cap below. 9 | local MONSTERS = {enabled = false, safe = {"rat", "snake"}} -- don't create when monsters on sceen enabled - true false, safe list, enter names. 10 | 11 | -- DON'T EDIT BELOW THIS LINE 12 | 13 | MONSTERS.safe = table.lower(MONSTERS.safe) 14 | 15 | function isMob() 16 | if not MONSTERS.enabled then return false end 17 | for _, c in ipairs(Creature.iMonsters(7, false)) do 18 | if not table.find(MONSTERS.safe, string.lower(c.name)) then 19 | return true 20 | end 21 | end 22 | return false 23 | end --> returns true or false if is monster on screen (safe list reading) 24 | 25 | Module.New("Conjure Arrows", function (mod) 26 | 27 | -- when Connected. 28 | if Self.isConnected() then 29 | 30 | -- load cap 31 | local cap = Self.Capity() 32 | 33 | -- when above limit. 34 | if cap > ITEM.cap then 35 | 36 | -- load amount (read bps + arrow slot.) 37 | local amount = Self.ItemCount(ITEM.id) + Self.Ammo().count 38 | 39 | -- when amount will below limit. 40 | if amount < ITEM.amount then 41 | 42 | -- check mana. 43 | if Self.Mana() >= SPELL.mana then 44 | 45 | -- when no mobs 46 | if not isMob() then 47 | 48 | -- cast Spell. 49 | Self.Say(SPELL.name) 50 | 51 | end 52 | 53 | end 54 | 55 | end 56 | 57 | end 58 | 59 | end 60 | 61 | -- module daly 62 | mod:Delay(500, 800) 63 | 64 | end) 65 | -------------------------------------------------------------------------------- /Restore Mana with conditions.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Script Name: Restore Mana with conditions 3 | Description: Drink mana fluids/potions/runes depend on conditions like: walking, looting, monsters, hpperc 4 | Author: Ascer - example 5 | ]] 6 | 7 | local config = { 8 | item = 3157, -- item id to restore mana 9 | minHpperc = 50, -- don't restore mana if hpperc below this value. 10 | mpperc = { 11 | ifConditionTrue = 20, -- when same condition meets requirements then character will restore mana on this level 12 | ifConditionFalse = 70, -- when all conditions don't meets requirements then character will restore mana on higher level. 13 | looting = false, -- when looting from monsters @enabled true/false 14 | walking = true, -- when walking @enabled true/false *works only when bot walks not you manually 15 | monsters = {enabled = true, amount = 1} -- when monsters on screen @enabled true/false, @amount - minimal mobs amount on screen 16 | }, 17 | delay = 1000 -- miliseconds between item usage 18 | } 19 | 20 | -- DON'T EDIT BELOW THIS LINE 21 | 22 | Module.New("Restore Mana with conditions", function() 23 | if Self.isConnected() then 24 | if Self.HealthPercent() > config.minHpperc then 25 | local value = config.mpperc.ifConditionFalse 26 | if config.mpperc.looting and Looter.isLooting() then value = config.mpperc.ifConditionTrue end 27 | if config.mpperc.walking and Self.isWalking() then value = config.mpperc.ifConditionTrue end 28 | if config.mpperc.monsters.enabled and table.count(Creature.iMonsters(7, false)) >= config.mpperc.monsters.amount then value = config.mpperc.ifConditionTrue end 29 | if Self.ManaPercent() <= value then 30 | Self.UseItemWithMe(config.item, config.delay) 31 | end 32 | end 33 | end 34 | end) --------------------------------------------------------------------------------