View unanswered posts | View active topics It is currently Thu Mar 28, 2024 11:45 pm



Reply to topic  [ 2 posts ] 
 Automated BigBang for TWX Proxy! 
Author Message
Ambassador
User avatar

Joined: Wed Apr 20, 2011 1:19 pm
Posts: 2559
Location: Oklahoma City, OK 73170 US
Unread post Automated BigBang for TWX Proxy!
Automated BigBang for TWX Proxy:

Code:

echo "**Automated BigBang.**"

#Get game letter from TWX Database (Setup Screen)
#$Game := GAME

#or set manually
$Game := "z"

#Note: Leading Zeros are required, and time is
#      military (00-23 with no AM/PM)
$StartDate := "03/11/2023"
$StartTime := "21:00"

:Wait
getDate $Date
splitText $Date $D "/"
$Month := $D[1]
$Day := $D[2]
$Year := $D[3]

getTime $Time
splitText $Time $T ": "
$Hour := $T[1]
$Minute := $T[2]
$Seconds := $T[3]
$AmPm := $T[4]

echo "*The time is " $Hour ":" $Minute " " $AmPm " Waiting Until 8:00 PM to run BigBang.*"

if ($Hour = 8) and ($Minute = "00") and ($AmPm = "PM")
   goto :Start
end

#Wait 1 minute before checking again
setDelayTrigger TO :Wait 60000
pause

:Start

if (CONNECTED)
    disconnect
end

setDelayTrigger    TO :Start 60000
setTextTrigger T4 :Login "Please enter your name"
setTextTrigger T3 :SelMenu "Selection (? for menu):"
connect
pause

:Login
    send NAME "*" PASSWORD "*"
    pause

:SelMenu
    killAllTriggers

    #Take Game Offline

    setTextTrigger A1 :Active "as INACTIVE.  Are you sure?"
    setTextTrigger A2 :Inactive "as ACTIVE.  Are you sure?"
    send #42 "9" $Game
    pause
   
    :Active
    send "yq"
    goto :BigBang
   
    :Inactive
    send "n*q"
    goto :BigBang
   
    :BigBang
    killAllTriggers
    #Run BigBang
    send "B" $Game "ya"
    waitFor "BigBang Setup"

    #Set new Random Seed
    send "r*0*"
    waitFor "BigBang Setup"

    #Start BigBang
    send "z*"
    # Using WaitON, because we want to capture the line.
    WaitOn "This BigBang generation"
    $Finished := CURRENTLINE

    # But waitfor is required for prompts:
    waitfor "Selection (? for menu):"

    #Activate Game
    #send #42 "9" $Game "yq"

    # -=- OR -=-

    #Schedule Game Start
    send #42 "0" $Game $StartDate "*" $StartTime "*"
    waitfor "Game will start on"

    echo "** -=- " $Finished "*"
disconnect

#Wait 1 to make sure it doesn't fire immediatly
setDelayTrigger TO :Wait 60000
pause

_________________
Regards,
Micro

Website: http://www.microblaster.net
TWGS2.20b/TW3.34: telnet://twgs.microblaster.net:2002

ICQ is Dead Jim! Join us on Discord:
https://discord.gg/zvEbArscMN


Sun Mar 12, 2023 5:59 pm
Profile ICQ YIM WWW
Ambassador
User avatar

Joined: Wed Apr 20, 2011 1:19 pm
Posts: 2559
Location: Oklahoma City, OK 73170 US
Unread post Re: Automated BigBang for TWX Proxy!
To Simplify the above code, I have added two additional commands:

dateTimeAdd - Increments the Unix/Julian Datetimes by specified amount.
getDateOnly - Retrieves the current Unix/Julian Date Only.

You can also get parts of a Unix/Julian Datetime:
Code:
getDateTime $var
echo "Today is " $var.NameOfWeekDay 
echo " which is the " $var.DayOfWeek "th Day of the week.*"
See the Wiki for details:
https://github.com/TW2002/twxp/wiki/What%27s-New%21

_________________
Regards,
Micro

Website: http://www.microblaster.net
TWGS2.20b/TW3.34: telnet://twgs.microblaster.net:2002

ICQ is Dead Jim! Join us on Discord:
https://discord.gg/zvEbArscMN


Thu Mar 16, 2023 6:20 pm
Profile ICQ YIM WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 25 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware.