Page 2 of 2
Re: Lootoption addon w/filter
Posted: Sun Feb 26, 2012 8:34 pm
by Romplayer
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
Re: Lootoption addon w/filter
Posted: Sun Feb 26, 2012 9:22 pm
by lisa
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
that is the first " and so anything after it is a string until the second "
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
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
the RoMScript would be
Code: Select all
RoMScript("Somefunction(\"sometext\",1,1)")
Re: Lootoption addon w/filter
Posted: Sun Feb 26, 2012 10:42 pm
by Romplayer
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?
Re: Lootoption addon w/filter
Posted: Mon Feb 27, 2012 2:09 am
by rock5
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
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
in game. I hope that helps your understanding.
Or just use the \" like Lisa said.
Re: Lootoption addon w/filter
Posted: Mon Feb 27, 2012 6:13 pm
by Romplayer
i tried that only lisa's genious worked
Re: Lootoption addon w/filter
Posted: Thu Mar 08, 2012 5:24 pm
by kuripot
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...
Re: Lootoption addon w/filter
Posted: Sat Mar 10, 2012 8:14 pm
by Romplayer
its on a name basis. Do you think i should put in wildcards?
Re: Lootoption addon w/filter
Posted: Sun Mar 25, 2012 2:04 am
by Romplayer
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
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
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.
Re: Lootoption addon w/filter
Posted: Sun Mar 25, 2012 2:24 am
by Romplayer
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.
Re: Lootoption addon w/filter
Posted: Sun Mar 25, 2012 2:42 am
by Romplayer
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.
Re: Lootoption addon w/filter
Posted: Sun Mar 25, 2012 4:04 am
by rock5
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.