Page 14 of 46

Re: rock5's "fastLogin Revisited"

Posted: Sun Jan 15, 2012 1:43 pm
by cufRet8e
rock5,
Is it possible to modify those fastlogin files, to make accountlogin.lua and logindialog.lua as one .lua file? It take a long time to fill all fields and looking for same fields in logindialog.lua file.

Re: rock5's "fastLogin Revisited"

Posted: Sun Jan 15, 2012 10:47 pm
by rock5
cufRet8e wrote:rock5,
Is it possible to modify those fastlogin files, to make accountlogin.lua and logindialog.lua as one .lua file? It take a long time to fill all fields and looking for same fields in logindialog.lua file.
No. These file names were not chosen by me. They are files that the game uses and we are replacing them. I could put the secondary passwords in accountlogin.lua but to make them available to logindialog.lua I would have to make the variable global and thereby unsecure.

So for securities sake, they have to be separate.

Re: rock5's "fastLogin Revisited"

Posted: Sat Jan 21, 2012 11:54 am
by bobdole
Giving this a try:

Code: Select all

RoMScript("ChangeChar(CHARACTER_SELECT.selectedIndex)")
waitForLoadingScreen()
loadPaths("eggs7")
The issues really is I am running probably one to many bots on the laptop and it causes freezes.

Re: rock5's "fastLogin Revisited"

Posted: Mon Jan 30, 2012 2:39 am
by Rickster
Hi,

I am using the following code to switch channel after each character change.
Changing char works fine, and the variable "channel" is printed out correctly, but while relogging it does not change to the given channel. The next character is on the same channel as the one before.

Code: Select all

		if ( 1 == RoMScript("GetCurrentParallelID()")) then
			channel = 2;
		elseif ( 2 == RoMScript("GetCurrentParallelID()")) then
			channel = 3;
		else 
			channel = 1;
		end;
		cprintf_ex("|lightgreen| Channel should change to %s.\n", channel);

		RoMScript("ChangeChar(nil,nil,channel)");
		waitForLoadingScreen(); yrest(4000);
Do you have any ideas what goes wrong?

Ric

Re: rock5's "fastLogin Revisited"

Posted: Mon Jan 30, 2012 3:01 am
by Rickster
I got the solution and did some minor changes, works now

Code: Select all

		channel = nil;
		repeat channel = RoMScript("GetCurrentParallelID()"); yrest(100); until channel;
		if ( switch_channel_local ) then
			if ( 3 >  channel) then
				channel = channel + 1;
			else 
				channel = 1;
			end;
			cprintf_ex("|lightgreen| Channel should change to %s.\n", channel);
		end;

		RoMScript("ChangeChar(nil,nil," .. channel .. ")");
1. using a repeat statement to get the channel coz RoMScript sometimes returns nil.
2. Increase channel until highest channel for that area, then switch back to 1
3. i had to resolve "channel" in the RoMScript because the game scope does not know about Micromacro variables.

Re: rock5's "fastLogin Revisited"

Posted: Mon Jan 30, 2012 4:28 am
by rock5
Rickster wrote:1. using a repeat statement to get the channel coz RoMScript sometimes returns nil.
RoMScript has been make quite reliable now. It's shouldn't need the repeat.

Re: rock5's "fastLogin Revisited"

Posted: Mon Jan 30, 2012 5:33 am
by Rickster
Is there a possibility to change channel when using ChangeChar() (Userfunction) while using multiple accounts?

Re: rock5's "fastLogin Revisited"

Posted: Mon Jan 30, 2012 6:51 am
by rock5
Rickster wrote:Is there a possibility to change channel when using ChangeChar() (Userfunction) while using multiple accounts?
Yes, just use

Code: Select all

 ChangeChar(char, acc, chan)

Re: rock5's "fastLogin Revisited"

Posted: Mon Jan 30, 2012 7:34 am
by Rickster
ah ok, thanx :)

but, when I again read my question, I see it was not clear, what I realy wanted to know ;) sorry ...

I want to cycle through some accounts, and to all chars within these accounts. thats what i acutally do:

Code: Select all

	SetCharList({
			   {account=1 , chars= {}},
			   {account=2 , chars= {}},
			   {account=3 , chars= {}},
			})

			LoginNextChar();
but I also would like to switch channel by the way, while relogging.
sure, i can switch channel after the new char is logged in, but i want to save some time.

I use just this, which logs in one character after the other for one account:

Code: Select all

RoMScript("ChangeChar(nil,nil," .. channel .. ")");
But I did not get the point how to combine these two ... Charset with multi accounts and channelswitching.

Re: rock5's "fastLogin Revisited"

Posted: Mon Jan 30, 2012 7:45 am
by lisa
I can't see a way to do what you want with current code.

I imagine if rock added in another argument to

Code: Select all

function LoginNextChar(_waypoint,channel)
channel = channel or nil
and then

Code: Select all

ChangeChar(nextChar, nextAcc,channel)
That would probably do the trick.

Re: rock5's "fastLogin Revisited"

Posted: Mon Jan 30, 2012 8:02 am
by rock5
I don't want to add arguments to LoginNextChar but you could do it like this

Code: Select all

         SetCharList({
            {account=1 , chars= {}},
            {account=2 , chars= {}},
            {account=3 , chars= {}},
         })

         local channel = RoMScript("GetCurrentParallelID()");
         if ( 3 >  channel) then
            channel = channel + 1;
         else 
            channel = 1;
         end;
         RoMScript("UserSelectedChannel = "..channel)

         LoginNextChar();

Re: rock5's "fastLogin Revisited"

Posted: Mon Jan 30, 2012 8:56 am
by lisa
Ahh cool, set it in the addon itself.

might need to be like this though

Code: Select all

RoMScript("UserSelectedChannel = '..channel..')")

Re: rock5's "fastLogin Revisited"

Posted: Mon Jan 30, 2012 12:33 pm
by rock5
Too many brackets on right side. It's not a function just a variable assignment. Which reminds me it should be like this because varables assignments don't work normally in RoMScript.

Code: Select all

RoMScript("} UserSelectedChannel = "..channel .." a={")

Re: rock5's "fastLogin Revisited"

Posted: Mon Jan 30, 2012 5:30 pm
by Rickster
Thanx for your ideas :)

my code now looks like this

Code: Select all

			switch_channel_local = true;
			[..]
			SetCharList({
			   {account=1 , chars= {}},
			   {account=2 , chars= {}},
			   {account=3 , chars= {}},
			})
			if ( switch_channel_local ) then
				channel = nil;
				channel = RoMScript("GetCurrentParallelID()");
				if ( 2 >  channel) then
					channel = channel + 1;
				else 
					channel = 1;
				end;
				cprintf_ex("|lightgreen| Channel should change to %s.\n", channel);
			end;
			RoMScript("} UserSelectedChannel = " .. channel .. " a={");
			LoginNextChar();
But it does not switch channel.
I do not realy understand whats happening here

Code: Select all

RoMScript("} UserSelectedChannel = " .. channel .. " a={");
I found "UserSelectedChannel" in the loginxml and asume this variable is set there, before relogging.
But I do not understand the syntax of the "},{" and what the "a=" is for.

This variable or the one which is needed to choose a new channel, is not set correct in the end.

Re: rock5's "fastLogin Revisited"

Posted: Mon Jan 30, 2012 11:03 pm
by rock5
Ah I see. It's being erased by the nil value of "channel" in that function.

Try this. Change line 213 of accountlogin.lua

Code: Select all

UserSelectedChannel = channel
to

Code: Select all

if channel ~= nil then UserSelectedChannel = channel end
If that works ok, I'll commit it.

Otherwise your code looks good except "channel" in your code should be declared local and you can make those 2 lines one.

So change

Code: Select all

            channel = nil;
            channel = RoMScript("GetCurrentParallelID()");
to

Code: Select all

            local channel = RoMScript("GetCurrentParallelID()");

Re: rock5's "fastLogin Revisited"

Posted: Tue Jan 31, 2012 9:11 am
by Rickster
rock5 wrote: Try this. Change line 213 of accountlogin.lua

Code: Select all

UserSelectedChannel = channel
to

Code: Select all

if channel ~= nil then UserSelectedChannel = channel end
If that works ok, I'll commit it.
that works very well :) thanks a lot!

the final code looks like this, which should help everybody, who wants to circle multiple characters on different accounts and also wants to switch channel

Code: Select all

			SetCharList({
			   {account=1 , chars= {}},
			   {account=2 , chars= {}},
			   {account=3 , chars= {}},
			})
			
			local channel = RoMScript("GetCurrentParallelID()");
			if ( 2 >  channel) then
				channel = channel + 1;
			else 
				channel = 1;
			end;

			RoMScript("} UserSelectedChannel = " .. channel .. " a={");

			LoginNextChar();

as always ... thanks rock!

Re: rock5's "fastLogin Revisited"

Posted: Tue Jan 31, 2012 9:43 am
by rock5
Maybe I'll add a function for changing the channel so you don't have to do that ugly RoMScript. Something like

Code: Select all

function ChangeChannelForNextLogin(num)
    RoMScript("} UserSelectedChannel = " .. num.. " a={");
end
That's about it. But the names a bit long. I didn't want to use just "ChangeChannel" because then people will think it will change channel when they use it, not after the login. Hm.. maybe "SetSelectedChannel" or "SetChannel".

Re: rock5's "fastLogin Revisited"

Posted: Tue Jan 31, 2012 4:15 pm
by Rickster
I have no probs with long function names as long as they describe what they do :)

A combination of your suggestions is my favorite:
SetChannelForNextLogin()

Re: rock5's "fastLogin Revisited"

Posted: Tue Jan 31, 2012 10:16 pm
by rock5
How about "SetChannelForLogin" to make it just that little bit shorter but still as clear I think.

Re: rock5's "fastLogin Revisited"

Posted: Wed Feb 01, 2012 6:07 am
by Rickster
This one is also fine.

You are the master ;) ... its up to you.