Page 1 of 1

character not in _ zone

Posted: Sat Nov 05, 2011 5:13 pm
by madgamer
hello been messing around with we scripts and was curious if there was a different way i could check to see if my character is a specific zone, for this script i am looking if character is in Logar

Code: Select all

<!-- Are you Prob not in zone -->
	if (player.Level > 50) or ((zoneid ~= 1001) and (zoneid ~= 1)) then
	printf(" .. We are in %s ..\n", zoneid);
	printf("This character probably Is Not in zone going to next!\n");
	nextplease()
	end
problem is that sometimes for whatever reason sometimes a character will be in Logar but both zoneid 1001 and 1 will be nil and cause error (low level char in logar will think its in limbo and log out)

is there a way to use words for zone check like "Logar" or "Kalin Shrine" etc

Re: character not in _ zone

Posted: Sat Nov 05, 2011 8:34 pm
by rock5
How and where are you getting the zoneid value?

Re: character not in _ zone

Posted: Sat Nov 05, 2011 9:12 pm
by lisa
madgamer wrote:sometimes a character will be in Logar but both zoneid 1001 and 1 will be nil
Assuming you use

Code: Select all

local zoneid = RoMScript("GetZoneID()")
If you are at the loading screen when checking zone with RoMScript it will error as you can't perform RoMScripts while at loadingscreen.
That is the only time I can think of where it wouldn't return the correct zone number but would instead error out.

Re: character not in _ zone

Posted: Sun Nov 06, 2011 2:02 am
by madgamer
yes im using

Code: Select all

local zoneid = RoMScript("GetZoneID()")
right on, maybe being that its on the OnLoad section it might initizatize b4 the characters all the way in maybe

Re: character not in _ zone

Posted: Sun Nov 06, 2011 2:24 am
by rock5
I'm assuming you are reloading a character. You should be waiting until the the character is fully loaded before reloading the waypoint file. Typically you would use

Code: Select all

waitForLoadingScreen()
After logging off and before reloading the waypoint file.

Re: character not in _ zone

Posted: Sun Nov 06, 2011 2:29 am
by lisa
I generally have this

Code: Select all

		sendMacro("}LoginNextToon=true;a={")
        sendMacro("Logout();"); 
		waitForLoadingScreen();
        loadPaths("WPname");

Re: character not in _ zone

Posted: Sun Nov 06, 2011 2:57 am
by madgamer
add

Code: Select all

 
local zoneid = RoMScript("GetZoneID()")
printf(" .. We are in %s ..\n", zoneid);
to the <OnLoad> of that lisa and "sometimes" the zoneid comes out a third option
not 1001 and not 1 for logar for example but error.

Re: character not in _ zone

Posted: Sun Nov 06, 2011 3:17 am
by lisa
Hmm how often does it happen?
I just went to logar and went in and out of house repeatedly, in and out of millers repeatedly. It always print 1, I did it in game though with

Code: Select all

/script SendSystemChat(GetZoneID())
Maybe you can try with the function I added for zone id

Code: Select all

<!-- Are you Prob not in zone -->
   if (player.Level > 50) or ((getZoneId() ~= 1001) and (getZoneId() ~= 1)) then
   printf(" .. We are in %s ..\n", zoneid);
   printf("This character probably Is Not in zone going to next!\n");
   nextplease()
   end


Re: character not in _ zone

Posted: Sun Nov 06, 2011 3:29 am
by rock5
It would be nice to know what error you get.

But I was just thinking, it might be possible that if you change character then immediately do a RoMScript that the macro key might not be setup properly yet. Normally the macros are set up again when it detects a diffent chatacter is loaded. That usually happens when 'player' is updated.

So try doing a 'player:update()' just after changing character, then try checking the zone. Although, if what I say above is true, then getting the zone id from memory, like lisa said, will also work.

Re: character not in _ zone

Posted: Sun Nov 06, 2011 3:29 am
by madgamer
sounds good, ill try that version and see if it works.
my problem coulda been from a not fully updated bot from a past patch, its def been awhile since ive tryed this.

thx again