Error in simple script

Ask for help

Moderators: Murderator+, Murderator

Post Reply
Sauza
Posts: 33
Joined: 2004-07-02 22:58:37

Error in simple script

Post by Sauza »

Code: Select all

var mocban="banco"
sub selmocban()
	if (mocban=="banco") then
		uo.exec("setreceivingcontainer banco")
		uo.print(">> Loot al Banco <<")
		uo.print(">> Loot al Banco <<")
		mocban="mochila"
	else
		uo.exec("setreceivingcontainer mochila")
		uo.print(">> Loot ala Mochila <<")
		uo.print(">> Loot ala Mochila <<")
		mocban="banco"
	end if
end sub
Banco and mochila are objects
This script must work as a switch, option 1 container banco, option 2 container mochila
Now it only switch one container an not change to another.

Help Me!
Thank you. =)
Yoko
Site Admin
Posts: 1964
Joined: 2004-04-03 16:49:38
Contact:

Post by Yoko »

global variables used through command uo.SetGlobal("name","textvalue") and uo.GetGlobal("name")
Sauza
Posts: 33
Joined: 2004-07-02 22:58:37

Post by Sauza »

Final Script
Thx Yoko :)

Code: Select all

sub selmocban()
	if (uo.GetGlobal("mocban")=="banco") then
		uo.exec("setreceivingcontainer banco")
		uo.print(">> Loot al Banco <<")
		uo.print(">> Loot al Banco <<")
		uo.SetGlobal("mocban","mochila")
	else
	uo.exec("setreceivingcontainer mochila")
		uo.print(">> Loot ala Mochila <<")
		uo.print(">> Loot ala Mochila <<")
		uo.SetGlobal("mocban","banco")
	end if
end sub
Sauza
Posts: 33
Joined: 2004-07-02 22:58:37

Post by Sauza »

This is wrong???

Code: Select all

sub loot()
uo.exec("load loot.sc")
end sub
Post Reply