Finding String

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Finding String

#1 Post by kenzu38 » Sun Jan 06, 2013 12:42 pm

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.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Finding String

#2 Post by rock5 » Sun Jan 06, 2013 12:56 pm

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

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Finding String

#3 Post by kenzu38 » Sun Jan 06, 2013 1:50 pm

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?

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Finding String

#4 Post by rock5 » Sun Jan 06, 2013 2:26 pm

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
Note1: it's untested.
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

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Finding String

#5 Post by kenzu38 » Mon Jan 07, 2013 3:21 am

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?

User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Finding String

#6 Post by botje » Mon Jan 07, 2013 4:17 am

looking tru item.lua, tier is not yet used.

rest is there though

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Finding String

#7 Post by lisa » Mon Jan 07, 2013 5:28 am

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.
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

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Finding String

#8 Post by kenzu38 » Mon Jan 07, 2013 1:18 pm

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?

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Finding String

#9 Post by rock5 » Mon Jan 07, 2013 2:40 pm

kenzu38 wrote:Anyway guyz, #item.Stats means the number of stats the item has?
Yes.
  • 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

User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Finding String

#10 Post by botje » Mon Jan 07, 2013 4:47 pm

but for runes,, you could easily add them to the forcekeep, and done xd

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Finding String

#11 Post by lisa » Mon Jan 07, 2013 6:35 pm

kenzu38 wrote:I was just thinking of customizing the cleanBag function to filter runes through tier.
yup the tier is in the name.
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

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Finding String

#12 Post by kenzu38 » Tue Jan 08, 2013 4:16 am

botje wrote:but for runes,, you could easily add them to the forcekeep, and done xd
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.
lisa wrote:yup the tier is in the name.
Harm II
Harm III
Harm IV
etc...
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?

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). :)
rock5 wrote:
kenzu38 wrote:Anyway guyz, #item.Stats means the number of stats the item has?
Yes.
Ok, thanks rock!

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Finding String

#13 Post by rock5 » Tue Jan 08, 2013 6:24 am

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

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Finding String

#14 Post by kenzu38 » Tue Jan 08, 2013 7:35 am

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! :D

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 19 guests