Finding String
Finding String
Hey guyz, like title says, I wanna know how I can find string from the game's tooltip. Reason is that I wanna collect 3 stat fusion stones that I get from CoT and I segregate them by stats they have. So Stam/Int/X stones get mailed to a mule char, Stam/Dex/X get mailed to another mule and so on.
Can anyone help me with this? Thanks.
Can anyone help me with this? Thanks.
Re: Finding String
The item class includes the stats of an item. The stats are saved in a table call Stats, ie. item.Stats and each stat includes the id and name of the stat, ie. item.Stats[1].Id and item[1].Name.
- 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: Finding String
Whoa, it's too complicated for me at my current level so if it's ok, maybe you can post a sample code that determines if a stone has Stam/Int/X stats to guide me?
Re: Finding String
Code: Select all
function itemHasStat(item, stat)
if (item.Stats[1] and item.Stats[1].Name == stat) or
(item.Stats[2] and item.Stats[2].Name == stat) or
(item.Stats[3] and item.Stats[3].Name == stat) then
return true
end
end
for slot = 61,120 do
item = inventory.BagSlot[slot]
if item.Name == "Fusion Stone" then
if #item.Stats == 1 then
-- send to mule 1
elseif itemHasStat(item, "Dexterity I") then
-- send to mule 2
elseif itemHasStat(item, "Intelligence I") then
-- send to mule 3
end
end
end
Note2: Checks all 60 slots of bag 1 and 2.
Note3: You have to put in the send commands
- 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: Finding String
Ok, thanks for this code! I'll begin testing this.
Quick question though, #item.Stats means the number of stats the item has?
And for tier, can you use something like item.Tier?
Quick question though, #item.Stats means the number of stats the item has?
And for tier, can you use something like item.Tier?
Re: Finding String
looking tru item.lua, tier is not yet used.
rest is there though
rest is there though
Re: Finding String
would we really need to know the tier of an item though?
If you are talking mana stone(might be fusion, can't remember which is which) the tier is in the name. I don't see a need to know the tier of an armor or weapon.
If you are talking mana stone(might be fusion, can't remember which is which) the tier is in the name. I don't see a need to know the tier of an armor or weapon.
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: Finding String
I was just thinking of customizing the cleanBag function to filter runes through tier. The recent events they made made me want to stock up on III runes.
Anyway guyz, #item.Stats means the number of stats the item has?
Anyway guyz, #item.Stats means the number of stats the item has?
Re: Finding String
Yes.kenzu38 wrote:Anyway guyz, #item.Stats means the number of stats the item has?
- 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: Finding String
but for runes,, you could easily add them to the forcekeep, and done xd
Re: Finding String
yup the tier is in the name.kenzu38 wrote:I was just thinking of customizing the cleanBag function to filter runes through tier.
Harm II
Harm III
Harm IV
etc...
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: Finding String
Lol yea but I thought it would be easier to just filter 2 tiers (Tiers 1 and 2 ) of runes than type all the names of those runes in the forcekeep table, including the ones you get from minigames (which is quite a lot). When the list gets bulky, it will be harder to add or remove items in the future.botje wrote:but for runes,, you could easily add them to the forcekeep, and done xd
I also thought of string.find but I just think it's less reliable than filtering items through tier (if possible, but turns out it's not). If I filter items with "I", would it also delete II, III, IV, IX?lisa wrote:yup the tier is in the name.
Harm II
Harm III
Harm IV
etc...
Anyway, this is easy to test myself, it's just that I'm hooked on some TV series right now and I wanna watch all the eps before I get back to playing (botting).
Ok, thanks rock!rock5 wrote:Yes.kenzu38 wrote:Anyway guyz, #item.Stats means the number of stats the item has?
Re: Finding String
Filtering by "I" will filter everything with "I" in it. But you can do more with patterns eg. " I$" will filter names that end in " I" (note the space, so only one "I"), " II$" will filter items ending in " II", etc.
- 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: Finding String
Hoho that's what I needed, didn't know about that pattern stuff. This'll make the bot delete exactly what I want it to.
As always, thanks a lot, rock!
As always, thanks a lot, rock!
Who is online
Users browsing this forum: No registered users and 7 guests