ScriptUO

Scripting Resources & Utilities => OpenEUO Scripts => OEUO => Scripting tools => Topic started by: Superslayer on October 18, 2010, 07:48:37 AM

Title: SuperSlayer's Auto Login Script for OpenEUO Version 1.8
Post by: Superslayer on October 18, 2010, 07:48:37 AM
Wow, this thing is wicked fast! This is kinda basic, not too advanced imo. And yes, this is my very first OpenEUO script ! Yay me! So without further delay,... :)

Code: [Select]
Script Name: SuperSlayer's Login
Author: SuperSlayer
Version: 1.8
Client Tested: 7.0.10.1
oEUO Version: 0.91.0008
Razor Version: 1.0.12.15
Shard: OSI
Public Release: 11-2-2010
Purpose: Relog your character in after daily maintenance, or any other time your connection is lost.

FYI: Shard numeric values have changed over the last year, so at the bottom of the script is a list
of shards and their values current as of 11-02-2010.

Setup Directions:
- Place your UO account name and password in the variables provided below. -Case SeNsiTivE !!
- If you know your shard is within the first 'x' many in the list, put that value in in 'Shards2Scan.
- Select the character to login by number. Top character slot = 1.
- Select the shard to login by number. Shard numeric values are at the bottom of this script for you.

Thanks and acknowledgments:
Kal for the original script structure, the entire scripting communities at SUO and EasyUO and Cheffe for OpenEUO !

Call the file from within your script and change character/shard without opening and changing the login script.
Use this example and be sure to set the correct atoms!
     
     setatom('Custom',true)        -- set the boolean value to true to use the atom set variable. Set to false to not use
     setatom('AN','BobsAccount')   -- your UO account name
     setatom('PW','BobsPassword')  -- your UO password
     setatom('S2',5)               -- shards to scan
     setatom('CS',1)               -- character slot
     setatom('SH',890981139)       -- shard to select by numeric value
     dofile('ss_autologinoeuov1.8.lua')
     
Loop it in your script with this example:

     repeat
     ** your code **
       if UO.CliLogged == false then
         wait(500)
         dofile('ss_autologinoeuov1.8.lua')
       end 
     ** your code **       
     until 1 == 2

Version 1.8
- Added ClientSwap function; confirms the client to log in to based on an empty 'CharName'.     
- Added additional login validation step to avoid hanging at character selection gump.
- Adjusted shard scanning technique to first scan for the existence of shard
    names and run a pixel sum test to verify.
- Misc. wait adjustments and subtle code changes to certain function
- Print function included to provide feedback to the user that the character is logged in, and
    the characters name is no longer "".

Version 1.7
- Removed LShard function in favor of speed of script and shard selection accuracy. Using LShard at login properly
  sets the last used shard, but during maintenance, the shards get reassigned. Otherwise, this is so fast
  that it still only takes less than a few seconds to get into the game.
- Added atom functionality so the script may be 'called' using variables set in your own script. Useful for bod
  collecting scripts, multi-account script setups, (Manwinc's army perhaps?) and more!
- Little more code cleanup as well.

Version 1.6
- Put LShard check in proper place -- oops!

Version 1.5
- Adjusted wait throughout script to better ensure values.
- Uses LShard if already logged in and connection is lost.
- Better control of single and double clicks.
Title: Re: SuperSlayer's Auto Login Script for OpenEUO
Post by: _C2_ on October 18, 2010, 08:07:31 AM
It the dofile command cap sensative; does it have to match your saved file name perfectly with caps/lowercase?  I know there are many commands that are so far from my learning. 
Title: Re: SuperSlayer's Auto Login Script for OpenEUO
Post by: Superslayer on October 18, 2010, 08:13:06 AM
nope, I just called it like this to see if it mattered and it worked just fine.
Quote
dofile('Ss_auTologinoEuov1.lua')
Title: Re: SuperSlayer's Auto Login Script for OpenEUO
Post by: Endless Night on October 18, 2010, 10:53:48 AM
nice super slayer..   I put in a request for #lshard to be made available again.. :)
Title: Re: SuperSlayer's Auto Login Script for OpenEUO
Post by: Superslayer on October 18, 2010, 05:09:08 PM
nice super slayer..   I put in a request for #lshard to be made available again.. :)

I've never used #lshard in euo, how would that be used in this?  Btw, I'll be posting an update for this in a little while, a few improvements and checks.
Title: Re: SuperSlayer's Auto Login Script for OpenEUO
Post by: _C2_ on October 18, 2010, 05:21:31 PM
i use lshard in my logger script.  you can set last shard on the login page where you put your mane and then just click the last shard symble on the next page instead of messing with shards on list.  it is really nice
Title: Re: SuperSlayer's Auto Login Script for OpenEUO
Post by: Endless Night on October 18, 2010, 05:42:22 PM
UO.LShard =   shard number ... (see wikki on EUO)

if you set above to the shard number you want prior to loggin in it will auto maktically set that as the default shard when you press enter that way you dont have to scroll down to the correct shard to select saves alot of headache.
Title: Re: SuperSlayer's Auto Login Script for OpenEUO
Post by: Superslayer on October 18, 2010, 06:09:33 PM
I'm working on this now, and my question is..when the shards go down for maintenance and LShard has a value of say, 45, will the shard even be selectable? Is 45 a unique identifier to the shard?
Title: Re: SuperSlayer's Auto Login Script for OpenEUO
Post by: Scrripty on October 18, 2010, 07:06:24 PM
I'm working on this now, and my question is..when the shards go down for maintenance and LShard has a value of say, 45, will the shard even be selectable? Is 45 a unique identifier to the shard?

Code: [Select]
; ============ Shard Numbers
; 0  = Atlantic            ; 19 = Oceania
; 1  = Lake Superior       ; 20 = Yamato
; 2  = Pacific             ; 21 = Asuka
; 3  = Great Lakes         ; 22 = Wakoku
; 5  = Baja                ; 23 = Hokuto
; 6  = Chesapeake          ; 24 = Europa
; 7  = Nappa Valley        ; 25 = Drachenfels
; 8  = Catskills           ; 26 = Formosa
; 9  = Sonoma              ; 27 = Izumo
; 10 = Lake Austin         ; 28 = Arirang
; 12 = Seige Perilous      ; 29 = Balhae
; 14 = Legends             ; 31 = Mizuho
; 16 = Sakura              ; 41 = Test Center
; 18 = Mugen               ; 45 = Origin
Title: Re: SuperSlayer's Auto Login Script for OpenEUO
Post by: Endless Night on October 18, 2010, 07:07:08 PM
I'm working on this now, and my question is..when the shards go down for maintenance and LShard has a value of say, 45, will the shard even be selectable? Is 45 a unique identifier to the shard?

well if you carnt normally login .. lshard is not gonig to make it so you can.
Title: Re: SuperSlayer's Auto Login Script for OpenEUO
Post by: Scrripty on October 18, 2010, 07:09:25 PM
I'm working on this now, and my question is..when the shards go down for maintenance and LShard has a value of say, 45, will the shard even be selectable? Is 45 a unique identifier to the shard?

well if you carnt normally login .. lshard is not gonig to make it so you can.

Also, you kinda have to set the #lshard at a specific spot in EUO.  At the login screen I believe.  But not sure for OEUO.  Haven't tested.
Title: Re: SuperSlayer's Auto Login Script for OpenEUO
Post by: NObama on October 18, 2010, 07:30:22 PM
Just in time for holiday gift season.  Well done.  I'll be stealing this to recreate C2's bod gatherer this weekend, if my trip to Napa falls thru.
Title: Re: SuperSlayer's Auto Login Script for OpenEUO Version 1.5
Post by: Superslayer on October 18, 2010, 10:37:39 PM
Good deal Nobama, just make sure you get the most recent version!

@Twinkle McNugget: It seems that what worked in EUO will be the same in OEUO, and that just leads me to believe that it's actually the way the client works. It doesn't look like the values you posted are matching with my attempts, but I'll play with it more.
Title: Re: SuperSlayer's Auto Login Script for OpenEUO Version 1.6
Post by: Superslayer on October 18, 2010, 11:10:29 PM
Sorry to whoever downloaded version 1.5, I didn't have the LShard check in the proper place!  Version 1.6 is up and is corrected.
Title: Re: SuperSlayer's Auto Login Script for OpenEUO Version 1.5
Post by: Scrripty on October 18, 2010, 11:25:01 PM
Good deal Nobama, just make sure you get the most recent version!

@Twinkle McNugget: It seems that what worked in EUO will be the same in OEUO, and that just leads me to believe that it's actually the way the client works. It doesn't look like the values you posted are matching with my attempts, but I'll play with it more.

I just looked at the variable pane in OEUO, and the number matched perfectly with the shard I was on... :)
Title: Re: SuperSlayer's Auto Login Script for OpenEUO Version 1.6
Post by: Superslayer on October 18, 2010, 11:43:45 PM
Odd, now it too shows for me,..little buggy still I suppose.
Title: Re: SuperSlayer's Auto Login Script for OpenEUO Version 1.7
Post by: Superslayer on October 22, 2010, 09:23:50 AM
Uploaded version 1.7

Version 1.7
- Removed LShard function in favor of speed of script and shard selection accuracy. Using LShard at login properly
  sets the last used shard, but during maintenance, the shards get reassigned. Otherwise, this is so fast
  that it still only takes less than a few seconds to get into the game.
- Added atom functionality so the script may be 'called' using variables set in your own script. Useful for bod
  collecting scripts, multi-account script setups, (Manwinc's army perhaps?) and more!
- Little more code cleanup as well.
Title: Re: SuperSlayer's Auto Login Script for OpenEUO Version 1.7
Post by: Superslayer on October 22, 2010, 10:07:54 AM
Here's an example of how swapping characters can work by calling the script with different shard and character parameters:
Start with your first char and shard login by filling in the atom variables like below:

Quote
setatom('Custom',true)                  -- set the boolean value to true to first set the atom variable for the first char/shard
setatom('AN','***')                        -- your UO account name in place of the asterisks
setatom('PW','***')                       -- your UO password in place of the asterisks
setatom('S2',5)                             -- shards to scan
setatom('CS',1)                              -- character slot
setatom('SH',890981139)               -- shard to select by numeric value
dofile('ss_autologinoeuov1.7.lua')   --call the login script
setatom('Custom',false)                 -- now turn off the custom atom variable telling the script to ignore the logged in character should they log out

Now you're logged in with the selected account, do your thing, and have your logout script run. Once your logout script has taken you to the login page, the next character can log in using the same method as above.  One script could look like this:

Code: [Select]
setatom('Custom',true)               
setatom('AN','***')                     
setatom('PW','***')                     
setatom('S2',5)                         
setatom('CS',1)                           
setatom('SH',890981139)             
dofile('ss_autologinoeuov1.7.lua') 
setatom('Custom',false)

** Run your code here **

logout
login next char

setatom('Custom',true)               
setatom('AN','***')                     
setatom('PW','***')                     
setatom('S2',5)                         
setatom('CS',1)                           
setatom('SH',890981139)             
dofile('ss_autologinoeuov1.7.lua') 
setatom('Custom',false)

Wanna be fancy? Make a table out of the logins, just don't change the atom variables themselves or the script won't work! :P ;)
Title: Re: SuperSlayer's Auto Login Script for OpenEUO Version 1.7
Post by: Dixie Wrecked on October 23, 2010, 11:30:26 AM
I have been messing around with this script for a little while today, trying to make a gift gathering script in OEUO for testing when they release the 13th anniversary gifts.  Anyway, everything seemed to be working well, but I am now having two problems with the script (and I shut down both OEUO and UO, as well as redownloaded version 1.7, to make sure I didn't accidentally change anything in there when getting the numbers for the shards):

1) The script does not seem to recognize Legends when scanning the shards; this is the first shard I have on my list, so it might be possible that it is just not scanning the first one?

2) Even though it recognizes other shards, it doesn't actually select any of them for me.  I have tested this with several shards, and while it moves down the list until it finds the correct shard, it does not actually choose the shard, instead logging into the last shard selected.  However, if I changed line 190 from:
Code: [Select]
    UO.Click(238,115,true,true,true,false)  --  click shard nameto:
Code: [Select]
    UO.Click(238,115,true,true,false,false)  --  click shard nameas well as commented out line 192:
Code: [Select]
    UO.Click(618,445,true,true,true,false)  -- click green arrowit does log into the correct shard, although it still doesn't recognize Legends. 

Anyway, I love the script so far, as it will definitely make finishing the Gift Gathering script a lot easier, and then I can turn my attention to seeing if I can write a BOD Gatherer as well! 
Title: Re: SuperSlayer's Auto Login Script for OpenEUO Version 1.7
Post by: Dixie Wrecked on October 23, 2010, 03:19:11 PM
OK, I did some more testing and found that the script is moving too fast between entering the account/password and scanning the shards.  When it gets to the shard selection screen, it seems to click the down arrow very quickly, moving the top shard from my screen.  After pausing the script and manually moving back to the top, it immediately found it, and with the above edit for the clicks, it finished logging in the correct character on the correct shard.  I added a wait(500) as line 143, right after the repeat loop would end from being the shard selection screen, as I am thinking that the shard selection screen may be the active window, but the shard names may take just a fraction of a second longer to load, and the script is so fast, that slight delay is still too much? 
Title: Re: SuperSlayer's Auto Login Script for OpenEUO Version 1.7
Post by: Superslayer on October 23, 2010, 03:52:18 PM
OK, I did some more testing and found that the script is moving too fast between entering the account/password and scanning the shards.  When it gets to the shard selection screen, it seems to click the down arrow very quickly, moving the top shard from my screen.  After pausing the script and manually moving back to the top, it immediately found it, and with the above edit for the clicks, it finished logging in the correct character on the correct shard.  I added a wait(500) as line 143, right after the repeat loop would end from being the shard selection screen, as I am thinking that the shard selection screen may be the active window, but the shard names may take just a fraction of a second longer to load, and the script is so fast, that slight delay is still too much? 

Awesome debugging work there Dixie! I had a hell of a time figuring out some other issues with this when it wasn't clicking and see'ing stuff correctly. It too turned out to be that the script was too dam fast. That 500 wait should be fine, and you could probably fine tune it slowly down to 250, if desired.

Creating clicks and double clicks is a little tricky since we don't that the 'd' parameter. We actually have to run the code twice with a wait in between for a double. However, just clicking in the client is a little 'off' as the client has to be the topmost/active window on the screen, otherwise, a single click will just just make the client window active, and not actually send a mouse click.

I'll continue to work on the shard scanning and update the script clicks as OEUO comes together.

Thanks again for the input with this script Dixie!
Title: Re: SuperSlayer's Auto Login Script for OpenEUO Version 1.7
Post by: Dixie Wrecked on October 31, 2010, 05:43:04 PM
OK, I've had another small hiccup with this script, I am guessing to due to a lack of lag (gotta love a script running too fast!).  In the function SelectChar(), it was hanging by waiting for the SysMsg to be "Welcome to Ultima Online!".  This message had appeared, but I believe due to a lot of other messages appearing as well, it missed that it had shown this message, and thus it was hanging.  I am not sure how a timeout would need to be handled though, as I did have a character logged in, but that doesn't mean this would always be the case?  Perhaps having it also check if UO.CharName ~= '', then have it continue on as well, as that would mean the character has logged in? 

Otherwise, this script is working great and really fast, so I am going to time it now as it logs in over 550 chars on 4 accounts so I can see just how quickly this moves!
Title: Re: SuperSlayer's Auto Login Script for OpenEUO Version 1.7
Post by: Superslayer on October 31, 2010, 05:54:05 PM
Glad to hear you're still liking it a bunch. I haven't messed with in a week or so, and I know I have a few strings to tighten with it.  I have 1.8 behind bars atm while I myself work with it.  In the mean time, you could place a wait before the check for the line "welcome to uo..." if ya want, or wait a few days 'till I throw 1.8 out here.
Title: Re: SuperSlayer's Auto Login Script for OpenEUO Version 1.8
Post by: Superslayer on November 02, 2010, 03:07:39 PM
Uploaded to version 1.8

Code: [Select]
Version 1.8
- Added ClientSwap function; confirms the client to log in to based on an empty 'CharName'.     
- Added additional login validation step to avoid hanging at character selection gump.
- Adjusted shard scanning technique to first scan for the existence of shard
    names and run a pixel sum test to verify.
- Misc. wait adjustments and subtle code changes to certain function
- Print function included to provide feedback to the user that the character is logged in, and
    the characters name is no longer "".
Title: Re: SuperSlayer's Auto Login Script for OpenEUO Version 1.8
Post by: Dixie Wrecked on December 16, 2010, 10:16:23 AM


Just an FYI that this script is "broken", as the gump values have been changed as follows:

line 153 - main menu gump from 42636 to 46764
line 165 - wait gump from 9524 to 13652
line 170 - shard selection gump from 40956 to 45084
line 200 - wait gump from 9524 to 13652
line 224 - main menu gump from 42636 to 46764
line 243 - wait gump from 9524 to 13652

line 249 already uses the ContName variable, but the commented value has changed from 19212 to 23340, in case that comes into play later.

I think that's all that was changed, and after changing these myself, the script works fine again!
Title: Re: SuperSlayer's Auto Login Script for OpenEUO Version 1.8
Post by: smokinjoe26 on February 10, 2012, 09:26:46 AM
Thank you much for the Auto Login Script SS .... it works like a charm after changing a few gump values much like Dixie mentions before me.  just had to figure out the new ones .... these must be due to updates.  No doubt they will more than likely change again in future updates.  Also thank you Dixie for your previous post.  I would not have learned how to do it on my own if it weren't for you.