Jump to content

zakne11

Members
  • Posts

    60
  • Joined

  • Last visited

  • Days Won

    8

Posts posted by zakne11

  1. On 2/19/2021 at 11:43 AM, kuzzuki said:

    Hey Zelek, I need 2 scripts.

    the first on the spell bit, but with a cold 3 seconds so that he does not spam on ROTS, the second is for treatment, so that he does not spam all the time because hotkeye are on F1 and spam is terrible

    auto(100)
    if not g_game.isOnline() then return end
    if  g_game.isAttacking() then
    	g_game.sendKey("F1")
    	sleep(3000)
    end

     

    • Like 1
  2. On 2/18/2021 at 2:26 PM, xcorek said:

    Hey Zelek, I need 2 scripts.

    1. barrier on if health 50%< ///  barrier off if health 50%>

    2. alarm if anyone on the vip list goes online 

     

    1. Just use  spell helaler

    2.

    auto(100)
    if not g_game.isOnline() then return end
    local messagesToDetect = {"xxx", "xxx", "xxx", "xxx"} -- which words should it look for?
    local respondToMessage = false -- should it respond if trigger word is found?
    local messageToRespond = "im here" -- what should it respond?
    local pauseBot = false -- should it pause the bot?
    local playAlarm = true -- should it play alarm?
    
    connect("g_game", "onTalkMessage", checkBotMessage)
    
    function checkBotText(mode, message)
      for _, messageToDetect in pairs(messagesToDetect) do
        if string.find(message, messageToDetect, 1, true) then
          if respondToMessage then
          	g_game.talk(messageToRespond)
          end
          if pauseBot then
          	setOption("Global/BotPaused", "true")
          end
          if playAlarm then
            for i = 1, 3 do
              playSound("alarm.wav")
              sleep(1000)
            end
          end
          return
        end
      end
    end

     

  3. 5 hours ago, victinhods said:

    Its possible some script to check task?

    17/200 Monster Killeds -> Check this msg in Default Channel

     

    Exemp: when 200/200 go to label "x" in cavebot

    local TextToFind = xxx
    local FoundMessage = false
    for k,v in pairs(g_game.getTextMessages()) do
      if v = TextToFind then
    	return FoundMessage = true
      end
    end
    
    if FoundMessage then
    gotolabel("HUNTING", "start-hunting")
    end

     

    • Like 1
  4. 21 hours ago, asktheages said:

    Hello!

     

    Im very happy with your bot. Unfortunately i lack scripting skills. Thats why i ask for one.

    I need a script that pauses every activity of the bot, when character leaves certain X Y box. If the character leaves it, script plays alarm. Also, after a little delay it presses a button (f1-f12).  End.

     

    To explain it better - if GM tp's me out of my respawn when i cavebot to another resp with same monsters, the bot will run ASAP to them. This is a sure ban, as human player would never act like this. He would stay and write some "??". 
    I had it on blackd back in the days. Thanks!

     

    local x =
    local y =
    local z =
    
    pos = g_game.getLocalPlayer():getPosition()
    
    if pos.x ~= x or pos.y ~= y or pos.z ~= z then
      playSound("alarm.wav")
        if getOption("Global/BotPaused") == "false" then
            setOption("Global/BotPaused", "true")
            sleep(300000)
        end
        if getOption("Global/BotPaused") == "true" then
            setOption("Global/BotPaused", "flase")
        end
    end
    
    auto(500)

     

  5. 2 hours ago, lediv said:

    if player on screen then type message on default. If he replies type another massage on default. and some pause delay with ~~10mins so that bot does not spam this. Is that script doable?

    local playersOnScreen = 0
    if i == nill then i = 0 end
    
    for _, creature in pairs(g_game.getCreatures()) do 
      if creature:isPlayer() then 
        playersOnScreen = playersOnScreen + 1 
      end
    end
    
    if playersOnScreen > 1 and i >= 1200 then
       g_game.talk("xxxx")
       i = 0
    end
    i = i + 1
    
    auto(500)

     

  6. 7 hours ago, victinhods said:

     

    someone?! Script to use spell to heal friend?! 

    its possible?

    @Zelek

    local player
    local playerhp
    local playername = xxxx
    
    for v, k in pairs(g_game.getCreatures()) do
            if k:getName() == "playername" and k:isPlayer() then
              player = k
        	  player:getHealthPercent() = playerhp
              break
            end
          end
    if playerhp <= 70 then 
      g_game.talk("exura sio" playername)
    end
    
    auto(250)

     

  7. 2 hours ago, danielbhte said:

    it didn't work for me
    I wanted him to face the monster and use spell "exemple exori vis"
     

    Turn you got posted previously, here i place condition for player detection

  8. 6 hours ago, danielbhte said:

    turn the character in front of the monster and use X spell
    if a player appears on the screen, stop using the spell
     

     

    use database to add conditions

     

    local playersOnScreen = 0 for _,
    creature in pairs(g_game.getCreatures()) do 
      if creature:isPlayer() then 
        playersOnScreen = playersOnScreen + 1 
      end
    end
    
    if playersOnScreen = 1 then
       ...

     

  9. 4 hours ago, Lucyfer said:

    Good Morning,

     

    Dear Admin,

     

    Please make two scripts for me:

    1) Character will always stand face to monster(its very usefully on rots when play gohan and need to use masenko during bot),

     

     

    you can take my long script few posts upper, and just adjust to rotation 

  10. 7 hours ago, neelix said:

    Hi, could you give me script for making targeting on / off ? I mean, when i use cavebot and made action, on 1sqm - targetnig = on, and second one targeting = on - to make lure 

     

    look on lure script on forum (works good)

  11. 22 hours ago, Rise said:

    Could you explain me this script? Don't understand last lines when i put hotkeys for that much spells?

     

    just got 6 attacking skills with different conditions

  12. On 1/10/2021 at 2:20 PM, Rise said:

    Better Turn to target.

     

    And im lookin for one more script for attack spells only if there are monsters within 3 sqms

    And script that attack with wave spell this side where is more monster in 8 sqms i mean like west are 3 monsters and east are coming 8, so it should turn to east and wave

     

    Not ideal as you ask, but made for my needs.

     

    if not g_game.isOnline() then return end
    
    local function wave5x3()
     
    local MonstersInRangeN = 0
    local MonstersInRangeE = 0
    local MonstersInRangeS = 0
    local MonstersInRangeW = 0
    local MonstersInActualRange = 0
    local direction = g_game.getLocalPlayer():getDirection()
     
    for _, creature in pairs(g_game.getCreatures()) do
      local playerPos = g_game.getLocalPlayer():getPosition()
      local creaturePos = creature:getPosition()
      local offsetX = playerPos.x - creaturePos.x
      local offsetY = playerPos.y - creaturePos.y
        if creature == nil then creature = playerPos end
          -- West 
        if creature:isMonster() and creaturePos:isInRange(playerPos, 5, 5) and offsetX >= 1 and offsetX <= 5 and offsetY <= 1 and offsetY >= -1 then
          MonstersInRangeW = MonstersInRangeW + 1
        end
    			-- East
        if creature:isMonster() and creaturePos:isInRange(playerPos, 5, 5) and offsetX >= -5 and offsetX <= -1 and offsetY <= 1 and offsetY >= -1 then			
    			MonstersInRangeE = MonstersInRangeE + 1
        end
    			-- North
        if creature:isMonster() and creaturePos:isInRange(playerPos, 5, 5) and offsetY >= 1 and offsetY <= 5  and offsetX <= 1 and offsetX >= -1 then 		
    			MonstersInRangeN = MonstersInRangeN + 1
        end
          -- Sauth
        if creature:isMonster() and creaturePos:isInRange(playerPos, 5, 5) and offsetY >= -5 and offsetY <= -1 and offsetX <= 1 and offsetX >= -1 then 		
    			MonstersInRangeS = MonstersInRangeS + 1
        end 	
     
    end
    
    local highest = 0
    local nums = {MonstersInRangeN, MonstersInRangeE, MonstersInRangeS, MonstersInRangeW}
    local bestdirection = direction
    
    for i,v in pairs(nums)do
    	if v > highest then
    	  highest = v
    	end
    end
    
    if highest == MonstersInRangeN and MonstersInRangeN > MonstersInRangeE and MonstersInRangeN > MonstersInRangeS and MonstersInRangeN > MonstersInRangeW then
    	bestdirection = 0
    end
    if highest == MonstersInRangeE and MonstersInRangeE > MonstersInRangeN and MonstersInRangeE > MonstersInRangeS and MonstersInRangeE > MonstersInRangeW then
    	bestdirection = 1
    end
    if highest == MonstersInRangeS and MonstersInRangeS > MonstersInRangeE and MonstersInRangeS > MonstersInRangeN and MonstersInRangeS > MonstersInRangeW then
    	bestdirection = 2
    end
    if highest == MonstersInRangeW and MonstersInRangeW > MonstersInRangeE and MonstersInRangeW > MonstersInRangeS and MonstersInRangeW > MonstersInRangeN then
    	bestdirection = 3
    end
    
    if direction == 0 then MonstersInActualRange = MonstersInRangeN end
    if direction == 1 then MonstersInActualRange = MonstersInRangeE end
    if direction == 2 then MonstersInActualRange = MonstersInRangeS end
    if direction == 3 then MonstersInActualRange = MonstersInRangeW end
    
    return MonstersInRangeN,MonstersInRangeE,MonstersInRangeS,MonstersInRangeW,MonstersInActualRange,bestdirection
    
    end	
    
    
    
    
    local MonstersInRangeN, MonstersInRangeE, MonstersInRangeS, MonstersInRangeW, MonstersInActualRange, bestdirection = wave5x3()
    local player = g_game.getLocalPlayer()
    local checkRange = 5
    local monsterinrange = 3
    local monsterinrangestand = 1
    local monsteraround2 = #g_game.getMonstersAround(2)
    local monsteraround1 = #g_game.getMonstersAround(1)
    local manapercent = g_game.getLocalPlayer():getManaPercent()
    
    if a == nil then a = 0 end
    
    
    if a ~= nil and a > 3 and monsteraround1 >= MonstersInActualRange and monsteraround1 >= 1 and g_game.isAttacking() and g_game.getIdleTime() > 300 then
          g_game.turn(g_game.getBestTurnDirection())
          a = 0
    end
    
    
    
    
    if g_game.isAttacking() then
      if manapercent >= 20 and monsteraround2 >= monsterinrange then
        g_game.sendKey("Fx")
      end
      if manapercent >= 20 and monsteraround2 >= monsterinrange*2 then
        g_game.sendKey("Fx")
      end
      if manapercent >= 20 and MonstersInActualRange >= 2 then
        g_game.sendKey("Fx")
      end
      if manapercent >= 20 and MonstersInActualRange >= monsterinrange then
        g_game.sendKey("Fx")
      end
      if manapercent >= 20 and MonstersInActualRange >= monsterinrange then
        g_game.sendKey("Fx")
      end
    end
    
    
    
    
    if a ~= nil then
    a=a+1
    end
    
    auto(250)

     

    • Like 1
  13. 2 hours ago, Msgsanta said:

    it needs a script to lure monsters, but when the monster has 50%, it kills it before it disappears

    if not g_game.isAttacking() then
      for _, creature in pairs(g_game.getCreatures()) do
        if creature:isMonster() and creature:getHealthPercent() <= 50 then	
          g_game.attack(creature)
          return
        end
      end
    end


    If you add it to previous lure it should solve your request.

  14. ok got propably crash of bot log, (add time stamp to logging will be helpfull. But this time just leaving spot when bot turns off.

    otclientbot.log

     

    	[C]: at 0x00ce8a50
    ERROR: protected lua call failed: LUA ERROR:
    attempt to call a userdata value
    stack traceback:
    	[C]: at 0x00ce8a50
    	[C]: in function 'createWidget'
    	/game_console/console.rsx:846: in function 'addTabText'
    	/game_console/console.rsx:749: in function 'addText'
    	/game_textmessage/textmessage.rsx:194: in function 'callback'
    	/gamelib/textmessages.rsx:11: in function </gamelib/textmessages.rsx:3>
    Lua Call Stack:
      [0] [C++]:-1 -- createWidget [C++]
      [1] /game_console/console.rsx:846 -- addTabText [Lua]
      [2] /game_console/console.rsx:749 -- addText [Lua]
      [3] /game_textmessage/textmessage.rsx:194 -- callback [Lua]
      [4] /gamelib/textmessages.rsx:11 -- <unknown> [Lua]
    
    ERROR: lua function callback failed: LUA ERROR:
    attempt to call a string value
    stack traceback:
    	[C]: at 0x00ce8a50	
    
    
    [C]: at 0x00ce8a50
    ERROR: ATTENTION the event list is not getting empty, this could be caused by some bad code
    ERROR: protected lua call failed: LUA ERROR:
    attempt to call a number value
    stack traceback:
    	[C]: at 0x00ce8a50
    ERROR: protected lua call failed: LUA ERROR:
    attempt to call a number value
    stack traceback:
    	[C]: at 0x00ce8a50
    ERROR: protected lua call failed: LUA ERROR:
    attempt to call a userdata value
    stack traceback:
    	[C]: at 0x00ce8a50
    	[C]: in function 'setCameraPosition'
    	/game_minimap/minimap.rsx:199: in function </game_minimap/minimap.rsx:192>
    Lua Call Stack:
      [0] [C++]:-1 -- setCameraPosition [C++]
      [1] /game_minimap/minimap.rsx:199 -- <unknown> [Lua]

     

  15. 1 hour ago, Grotos said:

     

    Could you add 2 conditions?

    Like mana req and monster distance?


     

    local healthToCast = 60
    
    local manaToCast = xx
    
    local range = x
    
    local monsterquantity = x
    
    
    local spellToCast = "exori"
    local player = g_game.getLocalPlayer()
    if g_game.isAttacking() and player:getHealthPercent() >= healthToCast and player:getManaPercent()>= manaToCast and #g_game.getMonstersAround(range) >= monsterquantity then
      g_game.talk(spellToCast)
      sleep(900, 1200)
    end
    auto(100)

     

     

     

    • Like 1
  16. Sorry for not complete description. 

     

    from targeting: no movement, chase, reach, keep away

    for manual play no movement works great, it attack from targeting list and do all things and dont push/impact any movement
    but when Cavebot, no movement stops our character in place until have no target.

     

    Idea is that to follow cavebot nodes without any movement from targeting, but keep it's usage

    (i know i can have it in script, but try to keep target list up to date for different creatures, and with stop function in 1 place, it's why i base on "isatacking")

     

    you place great lure script on forum, but it's base on complete turn off targeting, which is ok (but prefer to keep attacking for ROTS Kidrain, any target cause cavebot to use one of previously setted option " no movement, chace, reach, keep away")

    2 solutions:

    - add in cavebot to target but not apply any movement options

    - rename no movement to stop, add real no movement impact

    Hope now it's enough described 

  17. Hello, need script for follow player based on name, which do not disturb targeting, based on read send of position to move

     

    Something like:
     

    local toFollow = storage.followFriend
    local toFollowPos = {}
    
    local followMacro = macro(20, "follow target", function()
      local target = getCreatureByName(toFollow)
      if target then
        local tpos = target:getPosition()
        toFollowPos[tpos.z] = tpos
      end
      if player:isWalking() then return end
      local p = toFollowPos[posz()]
      if not p then return end if autoWalk(p, 20, {ignoreNonPathable=true, precision=1, ignoreStairs=false}) then
        delay(100)
      end
    end)
    addTextEdit("followfriend", storage.followFriend or "", function(widget, text)
      storage.followFriend = text
    end)
    
    onCreaturePositionChange(function(creature, newPos, oldPos)
      if creature:getName() == toFollow then
        toFollowPos[newPos.z] = newPos
      end
    end)

     

×
×
  • Create New...