ScriptUO
Official ScriptUO EasyUO Scripts => Script Snippets => Topic started by: KilroyIsDead on June 18, 2009, 04:01:30 PM
-
I think it's in release form. If you try to logout and it detects the disconnected or idle gump it will handle those and then log you in or out.
--Added deas from Khamelon and Cerveza (Woot to they!)
It's now using the TrailMyx call protocol
Now there is code that helps with detecting and handling the Idle or disconnected gumps
Closes Vet rewards gump
Handles being in the middle of the login prcess when sub routine is called
When Logging out you can set an amount of time to wait before failure. This is useful so that you don't hang in my bad code ;(
There is now a force logout parameter when you call the login. If this is set and it's determined you are already logged in then you'll be logged out first. This is for folks that two calls is just TOO much.
I corrected the Logout header so it shows the logout description instead of the login description.
I built this to help the zoo donator so that I could recall and fastlog instead of gating For this I set the Expedite to true which logs me back into the same account and shard
But you can also log into any number of different accounts and shards and characters on each
set !PGLoginScript C:\UO\Scripts\PGUtils\PG.Login.suo
set %YourAcountName YourAccountName
set %YourPassword YourPassword
set %YourShard Atlantic
set %YourAltShard Great_Lakes
set %YourCharIndex 3
set %YourAltCharIndex 0
display ok This logs you into your account identified by the settings
call !PGLoginScript PG_Login %YourAcountName %YourPassword %YourShard %YourCharIndex paperdoll_gump 30 #False #True
display ok #Result
display ok This is the caddillac you can be logged in or out and it will very quickly log you into you last character (The shard has to be set here as we double check that you are logging back into the correct shard, one reason you might not is that the shard is down.)
call !PGLoginScript PG_Login %YourAcountName %YourPassword %YourShard %YourCharIndex paperdoll_gump 30 #True #True
display ok #Result
display ok This will log you out, and allow for 5 seconds before failing
call !PGLoginScript PG_Logout 5
display ok #Result
display ok This will log you in from a logged out state, since the last test should have logged you out, and allow for 30 seconds before failing
call !PGLoginScript PG_Login %YourAcountName %YourPassword %YourShard %YourCharIndex paperdoll_gump 30 #True #True
display ok #Result
display ok This will log you in using the the clicks and typing instead of just assuming the defaults on each screen
call !PGLoginScript PG_Login %YourAcountName %YourPassword %YourShard %YourCharIndex paperdoll_gump 30 #False #True
display ok #Result
display ok This will log you in to your alt account info using the the clicks and typing instead of just assuming the defaults on each screen
call !PGLoginScript PG_Login %YourAcountName %YourPassword %YourAltShard %YourAltCharIndex paperdoll_gump 30 #False #True
display ok #Result
halt
-
in the character select screen this code right here does not work for Two Word Shards.
why? !Shard is split with #SPC its gonna need the Underscore put back into the !LastShard Var.
;Am I on the right shard?
if ! . PG_Login_Shard_ . !Shard <> #LShard
-
nice catch I'll fix that tonight
-
Updated to work on multiple word shards
I'm getting 3 second relogs, my connection must be good tonight
-
what id really like to see is a log out at this time, and log back in at this time.. should be easy to add simple Time adjusters.
-
Oh yeah that's pretty easy and would just be a wrapper of either of these subs
The reason I created this was that for the zoo donator when I was doing something other than unicorns/kirins I had to gate back and my chars can't regen the Mana fast enough, so now I just recall back to the zoo and do a quick log to get the animals there. It helps alot with the polar bears because most of them have been tamed and released so many time they are typically confused and don't like to follow.
I'll add a couple wrappers for the logout(Time) Login(Time)
Would it be useful to have a logout, wait x mins, login or force the developer to determine the actual times based upon their wiat x min needs?
-
Actual times would rock.... have a call to the sub and if it's at the user's set time (or later) then log out and wait till the user's set log in time, then log back in.
-
ya I'm gonna play with this a bit I've already played with something similar to this except instead of logging out I just had the character stand around until the disconnection gump popped up.
btw.. Im getting like 2s login times
-
I had constants on the lost connection gump and the other one that says if you don't do something in a minute I'll log you. So I wanted to detect and relog you on those. But I think those are all developer design issues.
I get the impression your loop would look like this...
Repeat
...
;If it's ever greater than 5:57 this would log you out
gosub Logout(5:57p)
...
until
But I would think the loop looks more like this...
repeat
...
if Now > 5:57p && ImStillLoggedIn
gosub logout
if now > 7:15p && ImStillLoggedOut
gosub login
...
until
-
Something along those lines....
sub logout_login_timer
if now = or > the %logout time
{
gosub logout
while now > logout && now < login
wait 0
gosub login
}
return
Just off the top of my head there....
-
hehe I already got it working in a script.
Set %LogOut 070000
Set %Login 073000
mainloop:
If #Clilogged = 1 && #Time >= %Logout && #Time <= %Login
gosub PG_Logout
If #Clilogged = 0 && #Time >= %Login
gosub PG_Login %AccountName %Password !Shard 4 paperdoll_gump 30 #True ; This logs you in assuming same account, shard and character
If #Clilogged = 0
Goto MainLoop
-
hehe I already got it working in a script.
Set %LogOut 070000
Set %Login 073000
mainloop:
If #Clilogged = 1 && #Time >= %Logout && #Time <= %Login
gosub PG_Logout
If #Clilogged = 0 && #Time >= %Login
gosub PG_Login %AccountName %Password !Shard 4 paperdoll_gump 30 #True ; This logs you in assuming same account, shard and character
If #Clilogged = 0
Goto MainLoop
Brilliant, I'm guessing you're using this for a always running script
By using that last parm #True you're requesting to come back to the same account shard and then char 4
I was thinking about doing this
acct1 char1 is my miner
Mine until it's bod time, Go get some bods, continue mining
mainloop:
gosub Mine
if #Time > !BodTime
{
gosub GetBods
gosub logout
gosub login acct1 char2
gosub GetBods
gosub logout
gosub login acct2 char1
gosub GetBods
gosub logout
gosub login acct1 char1
set !BodTime #Time + 6hrs
}
goto MainLoop
-
I've wondered why I haven't Seen that in a Miner Script Myself.
And yes.. I have this in a Always Running Script
-
Updated to use safer waits for the gumps
This now also handles being down the login path (Shard selection or character selection screen) and still being able to login
This closes the vet rewards gump
-
does this have a Fail-Safe Feature if the shard is not listed? wait like a Min or what ever, and try to log in until Successful?
-
Kinda, If you're shard is not available, it returns a message, something like you shard is not there. So if you detect thta message you can retry
-
I'll have to play around with this then and see what sorta of behavior I get.
-
It's something like
Call Login account pwd shard
if result <> True
if Issue was shard
wait 300s and retry
-
nice