Lootoption addon w/filter

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Message
Author
Romplayer
Posts: 120
Joined: Wed Jan 11, 2012 10:07 am

Re: Lootoption addon w/filter

#21 Post by Romplayer » Sun Feb 26, 2012 8:34 pm

its so frustrating sometimes for example i don't get printf very well because i frequently get nils and it crashes the bot and when i try printf("..name..") i get "..name.." printed and not to mention ' commands combined with "
Oh well Lootoption works thats all that matters

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

Re: Lootoption addon w/filter

#22 Post by lisa » Sun Feb 26, 2012 9:22 pm

not sure I will be the best at explaining it but I will try.

if you have " " anything in between the " " will be a string.
so

Code: Select all

RoMScript(" 
that is the first " and so anything after it is a string until the second "

Code: Select all

RoMScript("Somefunction(1,1)")
So in that the Somefunction(1,1) is actually a string which is used in the function RoMScript.
So if you want to add in a variable to the function you need to do it outside of a string, so you end a string, add in variable then make another string for the rest.

Code: Select all

i = 1
RoMScript("Somefunction("  ..i..  ",1)")
Would be the same as

Code: Select all

RoMScript("Somefunction(1,1)")
So if you want to actually have a " as part of the string you tell it to that it is a character you want and not code to finish string, you do this with a \
So if you needed to do an ingame script of

Code: Select all

Somefunction("sometext",1,1)
the RoMScript would be

Code: Select all

RoMScript("Somefunction(\"sometext\",1,1)")
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

Romplayer
Posts: 120
Joined: Wed Jan 11, 2012 10:07 am

Re: Lootoption addon w/filter

#23 Post by Romplayer » Sun Feb 26, 2012 10:42 pm

Of course.. I see and understand now.. But Murphy's Law says that next time i try it it will not be the case and it makes me feel that it is wrong. I bet if I try the same method on the other function that took me a day and a half to get it to work, it will not work... i get the denote of /' and such /" and i remmber now that ' means it is a function call but i still mess up using /"../" and everything whoops there i go it is a backslash not forward slash or idk whatever. For me when i use excessive spacing also i fail terribly. I gotta quit b/c if i get into it i'll end up mushing together all my knowledge and lose like 80 I.Q. pts then i'll lose the inspiration which is 80% of programming. Did i mention u are AWESOME?

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

Re: Lootoption addon w/filter

#24 Post by rock5 » Mon Feb 27, 2012 2:09 am

Romplayer wrote:RoMScript('GettFilter("..name..");');
is just wrong.
Romplayer wrote:RoMScript("GettFilter('"..name.."');");
That looks like it should work. Lets say name = "Link Rune". It would equate to

Code: Select all

GettFilter('Link Rune');
in game. The only issue there is if you have a name with a '. You could reverse it.

Code: Select all

RoMScript('GettFilter("'..name..'");');
That would equate to

Code: Select all

GettFilter("Link Rune");
in game. I hope that helps your understanding.

Or just use the \" like Lisa said.
  • 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

Romplayer
Posts: 120
Joined: Wed Jan 11, 2012 10:07 am

Re: Lootoption addon w/filter

#25 Post by Romplayer » Mon Feb 27, 2012 6:13 pm

i tried that only lisa's genious worked

kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

Re: Lootoption addon w/filter

#26 Post by kuripot » Thu Mar 08, 2012 5:24 pm

i can only put individual.. cannot put in group?? i mean "Oranament Runes I","Oranament Runes II","Productions Rune","Rune I",,"Rune II","Rune III","Armor I",,"Armor II","Armor III","Armor IV" etc...

Romplayer
Posts: 120
Joined: Wed Jan 11, 2012 10:07 am

Re: Lootoption addon w/filter

#27 Post by Romplayer » Sat Mar 10, 2012 8:14 pm

its on a name basis. Do you think i should put in wildcards?

Romplayer
Posts: 120
Joined: Wed Jan 11, 2012 10:07 am

Re: Lootoption addon w/filter

#28 Post by Romplayer » Sun Mar 25, 2012 2:04 am

rock5 wrote:
Romplayer wrote:RoMScript('GettFilter("..name..");');
is just wrong.
Romplayer wrote:RoMScript("GettFilter('"..name.."');");
That looks like it should work. Lets say name = "Link Rune". It would equate to

Code: Select all

GettFilter('Link Rune');
in game. The only issue there is if you have a name with a '. You could reverse it.

Code: Select all

RoMScript('GettFilter("'..name..'");');
That would equate to

Code: Select all

GettFilter("Link Rune");
in game. I hope that helps your understanding.

Or just use the \" like Lisa said.
I think i remember my teacher saying that using a variable is 8 bytes of memory while a string is 16 bytes
so ' ' is 8 bytes and " " is 16 bytes. I had to get this off my chest. Because in a table function is 32 bytes so ' ' wouldn't work therefore u have to use the string modifer " " which is a 16 byte.

Romplayer
Posts: 120
Joined: Wed Jan 11, 2012 10:07 am

Re: Lootoption addon w/filter

#29 Post by Romplayer » Sun Mar 25, 2012 2:24 am

GAhh.. Therefore if i wanted to optimize my memory usage i would try something like
runthis = "Gettxt("..name..")"
or runthis = "Somefunction(\"sometext\",1,1)"
or something
then RoMScript('runthis');
or whatever something like that. If romscript is that slow... But I don't have a prob with it being slow.

Romplayer
Posts: 120
Joined: Wed Jan 11, 2012 10:07 am

Re: Lootoption addon w/filter

#30 Post by Romplayer » Sun Mar 25, 2012 2:42 am

Oh in ver .9 i'll have to add cards and recipies. Drop only recipies that u have learned. And maybe a Monstercardtooltip check on cards if it has been learned.

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

Re: Lootoption addon w/filter

#31 Post by rock5 » Sun Mar 25, 2012 4:04 am

Romplayer wrote:I think i remember my teacher saying that using a variable is 8 bytes of memory while a string is 16 bytes
so ' ' is 8 bytes and " " is 16 bytes. I had to get this off my chest. Because in a table function is 32 bytes so ' ' wouldn't work therefore u have to use the string modifer " " which is a 16 byte.
That doesn't sound right for lua. Maybe you were learning another language? Different rules apply for different languages. Or maybe I don't understand what you're saying.
  • 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

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 0 guests