Posts: 27
Threads: 9
Joined: Feb 2019
Reputation:
0
05-02-2021, 03:32 PM
(This post was last modified: 05-02-2021, 03:50 PM by swistax.)
Hello,
I have problem with use manafluid as "Supply" . I am writing "manafluid" , "vial of manafluid" and "7" and nothing works. With fireball rune it work pretty good.
Can you help me how use manafluid as supply?
And one more question because I can not find too.
Any script which can open and minimalize all BP inside main BP?
Posts: 2,390
Threads: 409
Joined: Jul 2018
Reputation:
61
You didn't mention where are you writing mana fluid or for what.
openitem(string/number item, string location, bool newWindow, number Index) [void]: Open an item located inside your containers, inventory or ground, depends of your location choice.
minimizewindow(string windowName) [void]: Minimize windows. Parameters can be: "equip".
|Only Registered members can see download links. | Click here to buy subscription or here to register.
Posts: 27
Threads: 9
Joined: Feb 2019
Reputation:
0
05-02-2021, 06:05 PM
(This post was last modified: 05-02-2021, 06:11 PM by swistax.)
Sorry, i wrote in theard. I want use it in script supply checker. If i have less than xxx manafluids then go to label xxx
|Only Registered members can see download links. | Click here to buy subscription or here to register.
So it should look like this?
openitem(Purple backpack, MainBP, bool newWindow, number Index)
??
Posts: 2,390
Threads: 409
Joined: Jul 2018
Reputation:
61
itemcount() works just fine mana fluids using the way you said you tried.
if itemcount('mana fluid') <= 10 then
...
end
I believe that mf id on Realera is 2, not 7.
if itemcount(2) <= 10 then
...
end
It's also possible to count from hotkey message like "Using one of 2 vials...", but it's bit harder if you don't what you are doing.
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.
If your main bp is a "red backpack" and you wanna open it then it should be like this
openitem('red backpack', 'back')
If your main bp is a "red backpack" and the backpack that you wanna open is a purple backpack then it should be like this:
openitem('purple backpack', 'red backpack', true)
After opening then you can use this to resize windows.
minimizewindow('red backpack')
wait(300, 500)
minimizewindow('purple backpack')
wait(300, 500)
Posts: 27
Threads: 9
Joined: Feb 2019
Reputation:
0
Is there option to check 2 supplies not only 1? I would Like to bot check manafluids and GFB and if anyone is under minimum then bot shoul go to label „Exit”
Posts: 2,390
Threads: 409
Joined: Jul 2018
Reputation:
61
05-03-2021, 05:58 PM
(This post was last modified: 05-03-2021, 06:05 PM by Arkilys.)
Hello.
Use if with both checks. I recommend you to learn LUA basics.
if itemcount(2) <= 10 or itemcount('great fireball rune') <= 10 then
...
end
|Only Registered members can see download links. | Click here to buy subscription or here to register.
local Rune = 'ultimate healing rune' -- Mana count to leave, it will go to LEAVE_LABEL.
local Rune_Backpack = 'green backpack' -- specific container (name, id or index) to check for runes.
local Rune_LeaveCount = 10
local Mana = 'mana fluid'
local Mana_Backpack = 'green backpack' -- specific container (name, id or index) to check for manas.
local Mana_LeaveCount = 10 -- Mana count to leave, it will go to LEAVE_LABEL.
local LEAVE_LABEL = 'Exit' -- Label to go if any of supplies above are below.
--[[ DON'T EDIT BELOW THIS LINE --]]
--[[ DON'T EDIT BELOW THIS LINE --]]
if connected() then
Rune = itemid(Rune)
Mana = itemid(Mana)
local Containers = getcontainers()
for i = 1, #Containers do
local cont = Containers[i]
local ContainerSlot = -1
local RunesCount = 0
local ManasCount = 0
local isRuneBP = false
local isManaBP = false
if (cont.name:lower() == Rune_Backpack:lower() or tostring(Rune_Backpack) == tostring(cont.index)) then
isRuneBP = true
elseif (cont.name:lower() == Mana_Backpack:lower() or tostring(Mana_Backpack) == tostring(cont.index)) then
isManaBP = true
end
if isRuneBP or isManaBP then
for j = 1, #cont.items do
local item = cont.items[j]
if itemhasflags(item.id, 4) then
ContainerSlot = item.index
elseif item.id == Rune then
RunesCount = RunesCount + item.count
elseif item.id == Mana then
ManasCount = ManasCount + item.count
end
end
if (isRuneBP and RunesCount <= Rune_LeaveCount) or (isManaBP and ManasCount <= Mana_LeaveCount) and ContainerSlot == -1 then
gotolabel(LEAVE_LABEL)
break
end
end
end
end
Posts: 2
Threads: 0
Joined: May 2020
Reputation:
0
05-08-2021, 01:24 PM
(This post was last modified: 05-08-2021, 09:05 PM by joehajt.)
hey I need a script that will read from the message how many potions I have and go back to the label if </> , someone is able to help me, please
screenmessage() [string] what should I type instead of a string
im using
if itemcountmsg('vial', 'Using one of 2 vials...')then
gotolabel('start')
but not working - 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:1: 2: 'end' expected (to close 'if' at line 1) near '<eof>'
Posts: 2
Threads: 0
Joined: May 2020
Reputation:
0
It's also possible to count from hotkey message like "Using one of 2 vials...", but it's bit harder if you don't what you are doing.
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.
please some could help me? its not workin
hey I need a script that will read from the message how many potions I have and go back to the label if </> , someone is able to help me, please
screenmessage() [string] what should I type instead of a string
im using
if itemcountmsg('vial', 'Using one of 2 vials...')then
gotolabel('start')
but not working - 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.loading="lazy" alt="[Image: biggrin.png]" class="mycode_img" /> oString:Cavebot/Action:1: 2: 'end' expected (to close 'if' at line 1) near '<eof>'
Posts: 2,390
Threads: 409
Joined: Jul 2018
Reputation:
61
05-09-2021, 05:55 AM
(This post was last modified: 05-09-2021, 05:58 AM by Arkilys.)
Hello.
My script above already counts mana fluids and runes.
There are several ways to count how many MF you have left. The safest way is with the script above, as it tells what you are seeing.
Checking from a message is risky, Bot reads the green message that appears on the screen and not from the chat. So if you don't know how to use the function properly for your hunt, you could die from a lack of supplies. For example: You use runes and mana fluids in the hunt, but only count the supply at a specific waypoint. So you have 10 mfs, use a mana to heal and then use a rune. Bot will not be able to count how many mana fluids you have.
Since you are using mf for hotkeys, I believe it would be possible for you to leave the last mp bp open and use itemcount() to count. Because these mfs will only be used when all others run out.
As you failed to create a simple script above, I guess that you have no skills with LUA, so I would say that it is dangerous to count using itemcountmsg, but you can try.
if itemcountmsg('vial', screenmessage()) <= 10 then
gotolabel('start')
end
As I said, it will only work when you have the green message showing up.
This will count from last green message (even if it's not showing up anymore), but may not work properly after refilling. Because you would refill but the last green message would still tell low vial count.
if itemcountmsg('vial', screenmessage(false)) <= 10 then
gotolabel('start')
end
|