Jump to content

Request Script


Zelek

Recommended Posts

Hello,

I needed a script where I would NOT target any creature with the name "Pet" in it.

For example, there is a creature called "Ricardo's Pet". When I have my targetting set to attack all monsters, it would NOT target the monster with "pet" in it.

Thank you so much in advance for all the help!

Link to comment
Share on other sites

2 hours ago, ricardo27 said:

Hello,

I needed a script where I would NOT target any creature with the name "Pet" in it.

For example, there is a creature called "Ricardo's Pet". When I have my targetting set to attack all monsters, it would NOT target the monster with "pet" in it.

Thank you so much in advance for all the help!

if not g_game.isAttacking() then 
  for _, creature in pairs(g_game.getCreatures()) do
    if creature:isMonster() and not string.match(creature:getName()), "Pet") then
      g_game.attack(creature)
    end
  end
end

 

Edited by zakne11
Link to comment
Share on other sites

3 hours ago, zakne11 said:


if not g_game.isAttacking() then 
  for _, creature in pairs(g_game.getCreatures()) do
    if creature:isMonster() and not string.match(creature:getName()), "Pet") then
      g_game.attack(creature)
    end
  end
end

 

It didn't work unfortunately.

It says "LUA ERROR: Direct use of "pairs(g_game.getCreatures())" is prohibited."

Thank you so much in advance for the help. Wasn't sure how to fix this LUA error.

Edited by ricardo27
Link to comment
Share on other sites

15 hours ago, ricardo27 said:

It didn't work unfortunately.

It says "LUA ERROR: Direct use of "pairs(g_game.getCreatures())" is prohibited."

Thank you so much in advance for the help. Wasn't sure how to fix this LUA error.

 

local allcreatures = g_game.getCreatures()
if not g_game.isAttacking() then 
  for _, creature in pairs(allcreatures) do
    if creature:isMonster() and not string.match(creature:getName()), "Pet") then
      g_game.attack(creature)
    end
  end
end

 

Link to comment
Share on other sites

15 minutes ago, zakne11 said:

 


local allcreatures = g_game.getCreatures()
if not g_game.isAttacking() then 
  for _, creature in pairs(allcreatures) do
    if creature:isMonster() and not string.match(creature:getName()), "Pet") then
      g_game.attack(creature)
    end
  end
end

 

Sorry still not working.

Error: [string "Require libs/main"..."]5: 'then' expected near ','

Thank you again for all the help!
 

Link to comment
Share on other sites

7 hours ago, shirako said:

Hello, 

i am looking for spells that can use for targetting that could be customizable

like exori, exori min, exori gran on multiple monsters

and single target when 1

that are just simple condition like, #g_game.getMonstersAround(x) >= y

for more complicated things you can use functions like

  • g_game.getBestAreaTurnDirection

  • g_game.getCreaturesInArea

Link to comment
Share on other sites

4 hours ago, zaphod1337 said:

Need single target and aoe spell, when not on cooldown. so it ues whenever its off cooldown, prefferably 2 different UEs so i can make it spawn mas flam and mas vis

There is no cooldown flag applied for bot,  you have to do your self countdown system

Link to comment
Share on other sites

On 5/25/2021 at 7:31 PM, tawr said:

can someone write script to turn off targeting if there are 0 monsters near character and turn on targeting with 5+ monsters on screen?

 

 

Please search the forum before posting.

Link to comment
Share on other sites

On 5/20/2021 at 8:47 PM, ricardo27 said:

Sorry still not working.

Error: [string "Require libs/main"..."]5: 'then' expected near ','

Thank you again for all the help!
 

did you find a solution for this need this also

Link to comment
Share on other sites

  • 2 weeks later...

can i have an script for Valoria ot, its an otserver whit 7.6 rules, so i need to usewith mana fluid and then throw it to me, like old times, and if you could make an script just like that but for throwing sd at target that would be the greatest thing ever and i would be so thankfull, thank you

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

ADD for this script "range" and "HP" Please

 

 

local manaToCast = 60 local spellToCast = "Spirit Cannon" local player = g_game.getLocalPlayer() if g_game.isAttacking() and player:getManaPercent() >= manaToCast then g_game.talk(spellToCast) sleep(700, 1000) end auto(100)

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
On 8/23/2021 at 7:31 AM, walszky said:

i need script please pause and start bot with key please 

 

how to attack with spells in Rots? Example i want rotation with 5 spells how i can do?

toggle pause hotkey script is included in the bot by default.

for spells in rots use 

g_game.sendKey("F1")

you can find plenty of examples here.

Link to comment
Share on other sites

How to make target spell to trigger when monster that is targetted is near 1sqm max 4 sqm from me. I mean that this script is trying to use spell even if target is 7sqm away from me.

?

 

local healthToCast = 75
local spellToCast = "thrusting beam"
local player = g_game.getLocalPlayer()
if g_game.isAttacking() and player:getHealthPercent() >= healthToCast then
  g_game.talk(spellToCast)
  sleep(900, 1100)
end
auto(100)

Link to comment
Share on other sites

×
×
  • Create New...