Cooldown of Items - Possible?
Cooldown of Items - Possible?
Hello guys,
being looking for this in the forum but could not find anything except the skill cooldown function.
I am trying to check instruments (lute, tamb) cooldown for a meme bot.
Is there any way to do this?
Thanks in advance.
being looking for this in the forum but could not find anything except the skill cooldown function.
I am trying to check instruments (lute, tamb) cooldown for a meme bot.
Is there any way to do this?
Thanks in advance.
Re: Cooldown of Items - Possible?
This is actually more complicated then you might imagine.
Item info doesn't show a cooldown for the item, so can't just go to the spot where the item info is kept.
Instead what frogster decided to do was create a cooldown for the instruments but also a cooldown for the buff at the same time.
As you may know you can't stack some instruments and also some instruments share the same cooldown.
So what they did was have 3 spots in memory that track the cooldown before the buff can be used.
I'll try to explain better with an example.
address1
address2
address3
If you use tambo address1 starts counting down from 3 mins, at the same time address2 starts counting down from 30, thats the buff time.
if you then use lute, address3 starts counting down from 3 mins
When address2 reaches 0 it then starts counting down from what ever address3 was at, address3 then stops counting down and stays with that value.
So at this stage address1 is cooldown of tambo and address2 is cooldown of lute (this example only)
When address1 reaches 1 it then starts counting down from what ever address2 was at and address2 then stays at that spot.
So once all cooldowns are finished
address1 = 0
address2 = 1-180 (what ever it was at before address1 reached 1)
address3 = 1-180 (what ever it was at before address2 reached 1)
Incase you wish to have a look in CE the addresses are as follows.
--=== aditional ===--
Those addresses arn't just for instruments, also include skillls/items.
More then 3 addresses aswell, I only used 3 as an example.
--=============--
Another interesting address is
9CFACC
It shows how many things are on cooldown, includes items and skills.
I guess you could check for if that address = 0 and then cast both instruments. but if you had a skill on cooldown it wouldn't show as 0.
It would be very difficult to track instrument cooldowns using memory.
I would suguest you just create a timer when using the instruments and track it that way. Aslong as the script isn't restarted it should work fine.
Item info doesn't show a cooldown for the item, so can't just go to the spot where the item info is kept.
Instead what frogster decided to do was create a cooldown for the instruments but also a cooldown for the buff at the same time.
As you may know you can't stack some instruments and also some instruments share the same cooldown.
So what they did was have 3 spots in memory that track the cooldown before the buff can be used.
I'll try to explain better with an example.
address1
address2
address3
If you use tambo address1 starts counting down from 3 mins, at the same time address2 starts counting down from 30, thats the buff time.
if you then use lute, address3 starts counting down from 3 mins
When address2 reaches 0 it then starts counting down from what ever address3 was at, address3 then stops counting down and stays with that value.
So at this stage address1 is cooldown of tambo and address2 is cooldown of lute (this example only)
When address1 reaches 1 it then starts counting down from what ever address2 was at and address2 then stays at that spot.
So once all cooldowns are finished
address1 = 0
address2 = 1-180 (what ever it was at before address1 reached 1)
address3 = 1-180 (what ever it was at before address2 reached 1)
Incase you wish to have a look in CE the addresses are as follows.
Code: Select all
9CE354
9CE370
9CE38C
Those addresses arn't just for instruments, also include skillls/items.
More then 3 addresses aswell, I only used 3 as an example.
--=============--
Another interesting address is
9CFACC
It shows how many things are on cooldown, includes items and skills.
I guess you could check for if that address = 0 and then cast both instruments. but if you had a skill on cooldown it wouldn't show as 0.
It would be very difficult to track instrument cooldowns using memory.
I would suguest you just create a timer when using the instruments and track it that way. Aslong as the script isn't restarted it should work fine.
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Cooldown of Items - Possible?
thanks Lisa for your reply.
It seems very complicate to realize, I think I will take your suggestion and try with a timer based condition.
It seems very complicate to realize, I think I will take your suggestion and try with a timer based condition.
Re: Cooldown of Items - Possible?
Lisa, that's interresting. I assume as the timers run out and the rest move up one, the frozen leftover timers are just obsolete memory areas. I assume also that 9CFACC also reduces in number as the cooldowns expire. You should be able to itterate through the active colldowns and look for a specific type of cooldown. If not found then that type of item isn't on cooldown. I'm assuming that there is some sort of id number assocciated with each timer otherwise how would the game be able to destinguish them. I'll have a quick look into it.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Cooldown of Items - Possible?
Looks like those addresses are not cooldowns but duration. I tested some pots and the timer went for 30 not 15. The cooldown is 15. We don't really need duration as we can just check if a buff or effect is still on.
I wonder if there is somewhere where cooldowns are stored like that.
I wonder if there is somewhere where cooldowns are stored like that.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Cooldown of Items - Possible?
If you haven't got any instruments try using a skill with long cooldown, like 5 mins.
address1 will be the cooldown and address2 will be the buff duration.
The 9CFACC address seems to be the number of cooldowns and not buff durations in that section of memory, I didn't test it extensively enough to say exactly what is in the area and what isn't as I decided it would just be simpler to do a timer when calling the instrument.
I did notice what appeard to be buff Id's and also item Id's in the same section so I assume you could do more work on it, what annoyed me was that when the countdowns move the info doesn't change so you could be getting information that is not only old but doesn't change.
I guess using the 9CFACC to determine how far into the memory you look would work.
address1 will be the cooldown and address2 will be the buff duration.
The 9CFACC address seems to be the number of cooldowns and not buff durations in that section of memory, I didn't test it extensively enough to say exactly what is in the area and what isn't as I decided it would just be simpler to do a timer when calling the instrument.
I did notice what appeard to be buff Id's and also item Id's in the same section so I assume you could do more work on it, what annoyed me was that when the countdowns move the info doesn't change so you could be getting information that is not only old but doesn't change.
I guess using the 9CFACC to determine how far into the memory you look would work.
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Cooldown of Items - Possible?
Not sure if I understood the original question right,
but how about putting the item into an actionbar and use
but how about putting the item into an actionbar and use
Code: Select all
cooldown, remaining = GetActionCooldown(slotnumber)
Re: Cooldown of Items - Possible?
If you have the instrument in your bag, not itemshop bag you can use this.
http://www.theromwiki.com/API:GetBagItemCooldown
Just wrote that by hand with no testing, obviously need to change the instrumentID to the actual instrument ID.
Also make sure the instrument is in a slot in your bag, NOT item shop bag.
http://www.theromwiki.com/API:GetBagItemCooldown
Code: Select all
item = inventory:findItem(instrumentID)
if item then
_slot = item.SlotNumber -- might need to use BagId instead of SlotNumber, can't remember which is which off hand.
end
repeat
local maxCD, CurrentCD = RoMScript("GetBagItemCooldown (".._slot..");")
yrest(1000) -- 1 second rest
until CurrentCD == 0
Also make sure the instrument is in a slot in your bag, NOT item shop bag.
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Cooldown of Items - Possible?
It looks like it starts at slot 1 so it wouldn't be the bagid. So that means you would have to use
I think you can use the shop bag. Just use
Yeh, I know. I always have to go complexifying things.
Code: Select all
_slot = item.SlotNumber - 60
Code: Select all
item = inventory:findItem(instrumentID)
if item then
if item.SlotNumber > 60 then
_slot = item.SlotNumber - 60
func = "GetBagItemCooldown"
elseif 51 > item.SlotNumber then
_slot = item.SlotNumber
func = "GetGoodsItemCooldown"
else
error("There is no cooldown function for the magic box. Take the item out of the box.")
end
end
repeat
local maxCD, CurrentCD = RoMScript(func.."(".._slot..");")
yrest(1000) -- 1 second rest
until CurrentCD == 0
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Cooldown of Items - Possible?
how can i use this for cooldown??
Code: Select all
if Magic_Tambourine == true then
if inventory:itemTotalCount(204463) >= 1 then
inventory:useItem(204463) -- 3 days
yrest(5500)
elseif inventory:itemTotalCount(204571) >= 1 then
inventory:useItem(204571) -- 7 days
yrest(5500)
elseif inventory:itemTotalCount(206420) >= 1 then
inventory:useItem(206420) -- 30 days
yrest(5500)
end
elseif Magic_Tambourine == party_true then
yrest(5500)
end
if Magic_Guitar == true then
if inventory:itemTotalCount(204461) >= 1 then
inventory:useItem(204461) -- 3 days
yrest(5500)
elseif inventory:itemTotalCount(206418) >= 1 then
inventory:useItem(206418) -- 7 days
yrest(5500)
elseif inventory:itemTotalCount(204569) >= 1 then
inventory:useItem(204569) -- 30 days
yrest(5500)
end
elseif Magic_Tambourine == party_true then
yrest(5500)
end
Re: Cooldown of Items - Possible?
is this correct?? i want to use as onload function
what id i need to use??
Code: Select all
function Cooldown()
item = inventory:findItem(instrumentID)
if item then
if item.SlotNumber > 60 then
_slot = item.SlotNumber - 60
func = "GetBagItemCooldown"
elseif 51 > item.SlotNumber then
_slot = item.SlotNumber
func = "GetGoodsItemCooldown"
else
error("There is no cooldown function for the magic box. Take the item out of the box.")
end
end
repeat
local maxCD, CurrentCD = RoMScript(func.."(".._slot..");")
yrest(1000) -- 1 second rest
until CurrentCD == 0
end
Re: Cooldown of Items - Possible?
It's easy to find the ID number.. just punch in whatever item you are looking for at runesdatabase.com. so for a magic guitar it's 204461 or 204543 (Not sure why there's two of them...)
So anyways.. It would be really helpful if the examples were easier to follow by giving a no kidding this is what your code will look like because when I see syntax like (".._slot..") I go... WTF do I type here? Is it actually supposed to look like ("1") where 1 is the bag slot or do I actually type? (".._slot..") is a lot different looking than ("1")
So anyways.. It would be really helpful if the examples were easier to follow by giving a no kidding this is what your code will look like because when I see syntax like (".._slot..") I go... WTF do I type here? Is it actually supposed to look like ("1") where 1 is the bag slot or do I actually type? (".._slot..") is a lot different looking than ("1")
Re: Cooldown of Items - Possible?
Here is an explanation of that.
When sending a string command in game with an option using RoMScript you can useYou would use that if you are always going to use 10.
But if you are using a variable then you need to insert it into the string. And because the variable only exists in the bot, not the game, you have to insert the value the variable holds, not the variable itself. So you would do.That's actually made up of 3 strings; "Function", var and ")". Put them together and you get "Function(10)".
Hope that clears it up.
When sending a string command in game with an option using RoMScript you can use
Code: Select all
RoMScript("Function(10)")
But if you are using a variable then you need to insert it into the string. And because the variable only exists in the bot, not the game, you have to insert the value the variable holds, not the variable itself. So you would do.
Code: Select all
var = 10
RoMScript("Function(" .. var .. ")")
Hope that clears it up.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Cooldown of Items - Possible?
Thanks Rock, that did help a lot. Slowly getting over my phobia of such odd texts in code.
But to clarify again, when the code says
We actually have to put the ###### where it says instrumentID above, right? so for a magic guitar it's one of those 204461 or 204543 numbers? but still that code then has to be linked by another if/then statement to enable bossbuff() function to work.. as in ... oh forget it lol
Just going to work on some sort of check buff scenario
But to clarify again, when the code says
Code: Select all
item = inventory:findItem(instrumentID)
Just going to work on some sort of check buff scenario
Re: Cooldown of Items - Possible?
inventory:findItem is a bot function so you don't have to do that stuff I showed you in my previous post. It returns a table variable that describes the found item or nil if it found nothing. So you could do something like
Note you don't have to use the item id unless you are trying to make it multilingual or just to make sure it uses the right item.
Code: Select all
item = inventory:findItem("Magic Guitar")
if item ~= nil then
item:use()
end
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Cooldown of Items - Possible?
Okay, here's a thought... Why can't I just use the get bag slot cooldown function (http://www.theromwiki.com/API:GetBagItemCooldown) similarly to this useitem function?
So...
errr maybe I'm missing something here LOL
Maybe this is closer?
That's a lot of cut/paste stuff you already posted somewhere
Code: Select all
if inventory:itemTotalCount(204544) > 0 then
inventory:useItem(204544);
Code: Select all
if local maxCD, CurrentCD = GetBagItemCooldown(1); < 0 then
inventory:useItem(204544);
Maybe this is closer?
Code: Select all
item = inventory:findItem("Magic Guitar")
if item ~= nil and local maxCD, CurrentCD = RoMScript("GetBagItemCooldown(".. (item.SlotNumber - 60) ..")") then
item:use()
end
Re: Cooldown of Items - Possible?
That last one was close but you can't assign values to variable in the if statement.
This is how I would do it.
This is how I would do it.
Code: Select all
local item = inventory:findItem("Magic Guitar")
if item ~= nil then
local maxCD, CurrentCD = RoMScript("GetBagItemCooldown(".. (item.SlotNumber - 60) ..")")
if CurrentCD == 0 then
item:use()
end
end
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Cooldown of Items - Possible?
Thanks Rock
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 4 guests