I have a dought with @var .@var

eKoh

New member
Messages
75
Points
0
I don't know in what scenarios I am supposed to use these kind of variables.

In script_commands.txt I get this:

@ <- A temporary variable attached to the character.

so if I do

set @newtag,1;

The player will have that tag, right?

And also How temporary is the variable?

.@ <- A scope variable.

I just don't understand the description. I have read it like 10 times...

Is this variable attached to the player and also the Npc? If so, which scenarios I would use a .@variable?

 
prontera,150,150,5 script TempSet 999,{@var = 1;.@var = 1;mes "Value has been Set";close;}prontera,148,148,5 script TempGet 999,{mes ".@var:"+.@var;mes "@var:"+@var;close;}
Above is example.

@var will be set till the character logs off(as said temporary)

.@var is set until the script execution,(i.e for that instance), that is if the script execution is stopped, .@var will be set to 0 again.

If you click on TempSet First(NPC Above), it will set both vars to 1.

then Click on TempGet, it will show @var as 1 and not .@var, since its new script been executed.

 
Oh I see, thank you man, your explanation was so easy to understand.
 
But I have another dought, currently I am working on a script, and I want to make a "Back" option like:
 
 

mes "What you want to do";switch ( select ("Thing 1:Thing 2")){ case 1:  mes "You selected thing 1";  next;   mes "What you want to do?";   switch ( select ("Thing 3:Back")){ case 1:   mes "You selected thing 3";   close;   end; //<- Also I don't know if I have to put end; instruction, because I already have a close; above. Do I?   case 2: "Go back instruction" // Is there an instruction that makes this?? end;end; case 2: mes "You selectend thing 2"; close; end;} 


 
Sorry for my noobness, how do I put code box here?:S

 
Last edited by a moderator:
Sorry for my noobness, how do I put code box here?:S
There's button before Quote, to put a codebox

end; //<- Also I don't know if I have to put end; instruction, because I already have a close; above. Do I? 
Nope, you are not required to put end; after close; since close will stop the script execution.

About Back, Something Like THis:

Code:
L_SomeLabel:mes "What you want to do";switch ( select ("Thing 1:Thing 2")){	case 1:		mes "You selected thing 1";		next;		mes "What you want to do?";		switch ( select ("Thing 3:Back")){			case 1:				mes "You selected thing 3";				close;			case 2:								next;				goto L_SomeLabel;				end;		}		 	case 2:		mes "You selectend thing 2";		close;}
 
Last edited by a moderator:
Ohh, thank you man. And I will test that Label function to make it work, I really appreciate all your help.

Update.

It works!! thank you a lot ;D! the sample:

Code:
			mes ""+.npc$+"";			mes "Ok, so ^0000FFautoloot^000000 it is";			mes "Please input the ^0000FF%^000000 you want";			goto L_Alootrate;			L_Alootrate:				input #alootrate;					mes "Great so is ^FF0000"+#alootrate+"%^000000 is fine?";					if ( select("Yes:No") == 1 ){						mes "There you go!";						atcommand "@autoloot "+#alootrate+"";						close;					}	else goto L_Alootrate;
 
Last edited by a moderator:
mes ""+.npc$+""; mes "Ok, so ^0000FFautoloot^000000 it is"; mes "Please input the ^0000FF%^000000 you want"; L_Alootrate: input #alootrate; mes "Great so is ^FF0000"+#alootrate+"%^000000 is fine?"; if ( select("Yes:No") == 1 ){ mes "There you go!"; atcommand "@autoloot "+#alootrate+""; close; } else goto L_Alootrate;
you don't need "goto L_Alootrate;" before the label, since the script is not ending there, even if (AnyLabel:) is found, it continues to execute.

the script ends if there's "close;" "close2;" or "end;" function.

 
Back
Top