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
How to check mana fluid in olders 8.0?
#1
Hello!
I'm new here, and wanna know how can i check mana fluids or other items in 8.0 (already have hotkey). I need to have open all my backpacks with fluids?
Thanks so much!!

#2
Hello.

That depends if you wanna check the exactly count OR if you wanna check when there are few items left (example: if 10 or less UHs). The most used methods are itemcount() or itemcountmsg().

1. itemcount
If you wanna know the EXACTLY COUNT using itemcount then you must have all backpacks open. It's the most accurate method.
However, if you just wanna check when UHs are going out then you just need to leave the last bp open. For example: You have 3 BPs of UH then leave the last bp open, so the function will check for this bp. Once you start to use the last bp of uhs, you will be able to know because the uhs on that bp will be gone.

itemcount(string/number item, optional string location name, optional boolean countEquipments) [number]: Represent the amount of defined items found on opened containers.

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



2. screenmessage() and itemcountmsg()
This method works based on messages green messages that shows in the middle of your screen when using an item by hotkeys. You will need to use screenmessage()
screenmessage() [string]: Returns the last green message that appeared to you. The optional parameter bool visible, true by default, if true will only return if the message is currently visible.
itemcountmsg(string item, string message) [number]: Returns the amount of items from a using on message. E.g.: itemcountmsg('vial', 'Using one of 2 vials...') will return value 2. itemcountmsg('vial', 'Using the last vial...') will return value 1.
Notice if you use itemcountmsg() with an item but the message is talking about another item OR message is invalid (not related to items) then it will return -1.

The script below checks if it's higher or equal than zero due to reason above. So it would not leave in case of last message related to another item for example.
local item = 'vial' -- mana fluid shows up as a vial on the green message.

local count = itemcountmsg('vial', screenmessage())
if count >= 0 and count <= 10 then
     gotolabel('leave')
end

3. Select server log and use getmessages() to read the "Using ..." message as well.
That's only useful for checking for runes on specific places. For example: Create an Action to select server log, check for supplies and select Default back.

#3
Sorry, but I didn't get it right, I'm doing an afk script, and I would like to after a full turn, check how many mana fluids I still have, and if less than X amount, then gotolabel Y. What would be the easiest way? Checking the green messages? If so, how would you do this? before using the command to check the message would I have to use the 1 vial so that it would check the green message?

#4
I just explained and also give examples, I'm not sure how can I explain better than that.

Check based on last green message that shows up. If the green message is not visible then it will not work.
if itemcountmsg('vial', screenmessage()) <= 10 then
     gotolabel('leave')
end

Check based on last green message that shows up. It will work no matter if green msg is visible or not.
if itemcountmsg('vial', screenmessage(false)) <= 10 then
     gotolabel('leave')
end

Check based item on open containers.
if itemcount('ultimate healing rune') <= 10 then
     gotolabel('leave')
end

#5
Arkilys, i tried to use the first two setups with condition <= 120 but the script make the character go back even if it has higher valeu than that.

if itemcountmsg('vial', screenmessage()) <= 120 then
gotolabel('LEAVE')
else
gotolabel('WEST')
end

is else used the correct way?

#6
The code is correct and should work, but as I said above, screenmessage() returns the last green message that shows up and if you don't set 1st parameter as false then it will only return if message is visible. That also means if you use a ROPE with hotkeys, the green message with "Using last rope..." will show up and may mess up as well, because it would return -1.

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

you can put in the code to use first a manafluids then check it if x manas go label can u make it please?

#8
If you really wanna use a mf before then use like this.
Btw... Make sure mana fluid is on your hotkeys XD
useitemoncreature('mana fluid', id())
wait(800, 1200)

local count = itemcountmsg('vial', screenmessage())
if count <= 10 then
     gotolabel('leave')
end

Alternatively, you can use this persistent, this will check for the green message and setup a variable 'LAST_COUNT' with its count when you are using a mana fluid (which shows as vial).
Then create an Action wpt to check for LAST_COUNT variable.

Persistent.
local ITEM = 'vial'

if LAST_COUNT == nil then
     LAST_COUNT = 0
end

local count = itemcountmsg(ITEM, screenmessage())
if count >= 0 then
     LAST_COUNT = count
end

setglobal('LAST_COUNT', LAST_COUNT)

Action wpt
local ITEM = 'vial'
local COUNT_TO_LEAVE = 10 -- Item count to leave

local count = itemcountmsg(ITEM, screenmessage())
if (count > 0 and count <= COUNT_TO_LEAVE) or (count == -1 and getglobal('LAST_COUNT') <= COUNT_TO_LEAVE) then
     gotolabel('leave')
end

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


Thx!!!
|Only Registered members can see download links. | Click here to buy subscription or here to register.
|Only Registered members can see download links. | Click here to buy subscription or here to register.alt="Smile" title="Smile" class="smilie smilie_1" /> i will try

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

Arkilys, tried this setup and got this error on console:

"10:20:03 - Core:Lua:ExecuteScript
|Only Registered members can see download links. | Click here to buy subscription or here to register.
|Only Registered members can see download links. | Click here to buy subscription or here to register.alt="Big Grin" title="Big Grin" class="smilie smilie_4" />oString:Cavebot/Action:#CHECKCAP: 5: attempt to call global 'getglobal' (a nil value)"

How can i fix it?



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016