Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
Now to look at the code you have given us. The way I see it read is like so:
If GV 183 is 170 then I'll check to see if GV 199 is 2. If it is then I'll remove 1 of item number 170 from the party. If it isn't then I'll set myself (GV 183) to 1.
This means that unless the 183 = 170 you will do nothing at and if it is then 183 wil end up at either 12 or 1. Then of course if 199 = 2 the parrty loses 1 of item 170.
if this is what you want to happen then I would say to make a class to define it in. We do this with the line 'class My_Class'. After we have done thatthen we must define what our class will do. This is acomplished by the line 'def my_Method'. Each of those lines will need their own End tags. I see that you already understand what those are and how they basically work. Within the method we defined is where we will put the code you have created. I have no idea if that is how you actually want it set up, but that is probably because I have no idea what you are doing.
Here is an example of what we have
@instance_class = My_Class.new
Unfortunatly all that does is create the class to call the method we would then add the following line after it (within the same script call command)
@instance_class.my_Method
Now your method has been called and the code has been parsed. If you want to check where your information ended up you can use msgbox commands
These will pop up a little box with the information inside the ( ). I cannot remember right now whether or not the " " are required. It is I tested it
This is all nice and all but what if I told you that we could make a small change and be able to run the code with a single line in the script call? Well we can! Every class will have a method called initialize. Wheather we define it or not it's there. The thing about the initialize method is that it is run as soon as the class is... well initialized. Clever Ruby huh? So the way we make it run our code on start up is simple. We add this:
This means that it will run that method as soon as it is created.
So now we have:
Now all we need is to use @instance_class = My_Class.new to get the code to run.
That's all for now because I need to go and get myself some food :P
http://i.imgur.com/8D2Txhw.png
Undefined variable or method for summer_Check, which is my_Method
I've added you so I can explain my process a bit more indepth as I don't want to really give away what I am doing publicly.
Oh I seem to have misread the last bit and I should be running the class, not the method. One moment as I test this.
Okay, this works absolutely perfectly. Thank you so much Kurashi. You can still accept my request if you'd like to know what I'm working on.