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
Force Refill
#1
Hello, im trying to make a force refill and im experiencing this error:

10:14:01 - Core:Lua:ExecuteScript:ForceRefill: 1162: invalid arguments to method call


code:
if cap() < 30 or attackingme('p') > 0 then
setsettings('Targeting/Creatures/Mutated Rat/Only if trapped', true)
if waypoint() > 29 then
gotolabel('LeaveNorth')
else
gotolabel('Leave')
end
end

#2
Hello.

There are 3 errors in your script:

Line #1 ->  attackingme('p')
This error is the one that's being told on console and the error message says pretty much everything: "invalid arguments to method call".

|Only Registered members can see download links. | Click here to buy subscription or here to register.

attackingme(number lastMILLISECONDS, optional string filter) [number]: Returns the amount of creatures (players and/or monsters) that are attacking you or attacked you in last milliseconds according parameters. Filter must be: 'p' => players, 'm' => monsters or 'pm' => players and monsters.

Example:
if cap() < 30 or attackingme(1000, 'p') > 0 then


Line #2 ->  setsettings('Targeting/Creatures/Mutated Rat/Only if trapped', true)
You probably used the "Copy Path" and this induced or generated this error because SETTING is missing in that path. It would not generate an error, but simply would not work.
So you would notice only if you think about this path in a logical way or when the bot did not change that option.

Example:
setsettings('Targeting/Creatures/Mutated Rat/Setting1/Only if trapped', true)


Line #3 ->  waypoint() > 29
The waypoint function returns a LUA TABLE, but you are comparing it to a number, because you probably want to compare with the waypoint's id.
|Only Registered members can see download links. | Click here to buy subscription or here to register.

waypoint() [table]
   .id [number]: ID number of waypoint.
   .name [string]: Wapoint label/name.
   .type [string]: Waypoint type (drop, action, node, stand, etc.).
   .x [number]: Waypoint X position.
   .y [number]: Waypoint Y position.
   .z [number]: Waypoint Z position.

Example:
if waypoint().id > 29 then

#3
Really thanks @Arkilys!!!

#4
Hello @Arkilys, i still having few problems...
First is, as u said the "only if trapped" was wrong but still does nothing with the new action.
Second is, seems like "if waypoint().id > 29 then" isnt working aswell, i made some changes on force refill to make action work only inside cave, i mean if it still running force refill while going to city, character will be forced to waypoint "Leave".

Code is :
if cap() < 3000 or attackingme(1000, 'p') > 0 and waypoint().id > 22 and waypoint().id < 66 then
setsettings('Targeting/Creatures/mutated rat/Setting1/Only if trapped', true)
if waypoint().id > 29 then
gotolabel('LeaveNorth')
else
gotolabel('Leave')
end
end


Ps: Lua console is empty

#5
|Only Registered members can see download links. | Click here to buy subscription or here to register.

Hello.

I didn't paid much attention on the full path (see how this happen? xD), but it's wrong.
There's "Creatures" after "Targeting" on your path, which should not have.

It should be:
setsettings('Targeting/mutated rat/Setting1/Only if trapped', true)

#6
thanks again @Arkilys, btw theres something wrong with waypoint().id?

#7
@Arkilys, news about waypoint().id?

#8
Hello.

It's working perfectly.



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016