Everyone who has never used our Bots before, can test each one for 2 days without any limitation.
The trial is given automatically when you login on the Bot, but in some cases it wouldn't work (security reasons).
If this happens, send me a private message and i will be checking the failed trials manually and adding it for those who didn't get it.
We are looking for resellers who may accept payment methods different from ours, including classictibia's cash, realesta's cash, mastercores' cash, etc. Interested? Click here at anytime.



Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with script
#1
local MANA_GAIN = 2
if connected() then
    LAST_MANA = LAST_MANA or mp()
    local current_mana = mp()
    if (current_mana - LAST_MANA) > MANA_GAIN then
        playsound('default')
        flashclient()
        printerror('Mana gain')
        pausebot(true)
    end

    LAST_MANA = current_mana
else
    LAST_MANA = nil
end

I use this script as a protection against the GM. But the script has an issue;

When I pause the bot the script remembers my mana at the moment the bot pauses, when I unpause the bot later with higher mana the script thinks my mana gain was higher than 2. The only way around it is to remove the persistent and add a new persistent. Apart from this, it works flawlessly. Maybe disable pause on bot pause?

Also, if I change everything to do the same thing but with health instead, would this work? Have not tested.
local HEALTH_GAIN = 10
if connected() then
    LAST_HEALTH = LAST_HEALTH or hp()
    local current_health = hp()
    if (current_health - LAST_HEALTH) > HEALTH_GAIN then
        playsound('default')
        flashclient()
        printerror('Health gain')
        pausebot(true)
    end
    LAST_HEALTH = current_health
else
    LAST_HEALTH = nil
end
Reply

#2
Disable option "Pause on Pause Bot?" for that persistent, so it will keep running even if Bot is paused. If you need then you can use botpaused() to know if Bot is paused and do something.
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016