Page 1 of 1

read account name?

Posted: Sat Aug 18, 2012 7:08 am
by langelot133
hello, i'm sorry to ask again for help but i've been searching for long with no result

i'd like to include a If function in a waypoint file reading the account name or number (using fastlogin if necessary) to do something for all the characters of one account but other things with a second account all using the same WP file



for example

Code: Select all

if accountname == XXXXXXX then
DOTHING
else
DOOTHERTHING
end
thanks for your help

Re: read account name?

Posted: Sat Aug 18, 2012 7:20 am
by rock5

Code: Select all

AccountNumber = RoMScript("LogID")
CharacterNumber = RoMScript("CHARACTER_SELECT.selectedIndex")

AccountName = RoMScript("GetAccountName()")
CharacterName = player.Name

Re: read account name?

Posted: Sat Aug 18, 2012 7:20 am
by lisa

Code: Select all

RoMScript("LogID")
if accountname == RoMScript("LogID") then
DOTHING
else
DOOTHERTHING
end
Ok Rock wins, by a few seconds and I put the code for acc number but said accountname lol

Re: read account name?

Posted: Sat Aug 18, 2012 7:30 am
by rock5
lisa wrote:Ok Rock wins
Yay! For once.

Re: read account name?

Posted: Sat Aug 18, 2012 3:29 pm
by langelot133
i'm going to try it right now
thanks for helping me



edit: like eveytime you help me, it works perfectly thanks :D
edit2: it work twice but now the bot still do one of the 3 account scripts i made ... maybe something wrong in my WP

Re: read account name?

Posted: Sun Aug 26, 2012 9:34 am
by langelot133
there is something i never know, and my wp file are sometime working and sometime not


should i put

Code: Select all

if "accountname" == RoMScript("GetAccountName()") then

or

Code: Select all

if accountname == RoMScript("GetAccountName()") then 

i never know when to put

Code: Select all

  "" 
or

Code: Select all

 == 
more than no

Code: Select all

 " 
or

Code: Select all

 = 

Re: read account name?

Posted: Sun Aug 26, 2012 12:48 pm
by rock5
"accountname" is a string. accountname is a variable.

Lets say your account name is "langelot". You could use

Code: Select all

if "langelot" == RoMScript("GetAccountName()") then
or you could use

Code: Select all

accountname = "langelot"
if accountname == RoMScript("GetAccountName()") then
= is used when you want to assign a value to a variable eg.

Code: Select all

variable = 5
== is used when making a comparison eg.

Code: Select all

if variable == 5 then
Hope that clears it up for you.

Re: read account name?

Posted: Tue Aug 28, 2012 7:14 am
by langelot
ok i thought it was something like that but wasn't sure , thanks for all your help rock