Well, no idea about the license to cover gamebot, let that be released under GPL license.
Stealthbot script:
' *
' * Copyright (C) 2015 il
' *
' * This program is free software; you can redistribute it and/or
' * modify it under the terms of the GNU General Public License
' * as published by the Free Software Foundation; either version 2
' * of the License, or (at your option) any later version.
' *
' * This program is distributed in the hope that it will be useful,
' * but WITHOUT ANY WARRANTY; without even the implied warranty of
' * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' * GNU General Public License for more details.
' *
' * You should have received a copy of the GNU General Public License
' * along with this program; if not, write to the Free Software
' * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
'il
'1.0
'&il_GameCreator:il
Public BotInChat, IsFirstJoin, TimerCheckAction, CheckActionAction, IsInGame, GameOwner
CreateObj "Timer", "TimerCheckAction"
Public BotInWork
BotInWork=0
' ----------------- Create file -------------------------------
Sub CreateFile(Filename)
Set fso = CreateObject("Scripting.FileSystemObject")
Set file = fso.OpenTextFile(Filename,8,True)
file.close
End Sub
' ----------------- Delete file -------------------------------
Sub DeleteFile(Filename)
Set fso = CreateObject("Scripting.FileSystemObject")
Set file = fso.DeleteFile(Filename)
file.close
End Sub
' ----------------- Write to file -----------------------------
Sub WriteToFile(Filename,Message)
Set fso = CreateObject("Scripting.FileSystemObject")
Set file = fso.OpenTextFile(Filename, 2, False)
file.WriteLine Message
file.Close
End Sub
' ----------------- log ---------------------------------------
Sub Log(Message)
AddQ "/w il " & Message
End Sub
' ----------------- Timer to check if command is finished -----
Sub TimerCheckAction_Timer()
Log "timer event handled: " & CheckActionAction
If IsInGame = 0 Then
TimerCheckAction.Enabled = False
WriteToFile "c:\nnCron\resetwar2.sem", ""
Init
Else
WriteToFile "c:\nnCron\gamestep" & IsInGame & ".sem", ""
IsInGame = IsInGame - 1
End If
End Sub
' ----------------- Start timer to check required action ------
Sub CheckAction(Interval, Action)
Log "starting timer"
TimerCheckAction.Interval = Interval
CheckActionAction = Action
TimerCheckAction.Enabled = True
End Sub
' ----------------- Init --------------------------------------
Sub Init()
BotInChat = 0
IsFirstJoin = 1
IsInGame = 0
CheckAction 20000, "IsFirstJoin"
End Sub
' ----------------- user whispers command ---------------------
Sub il_Event_WhisperFromUser(Username, Flags, Message, Ping)
If BotInWork = 0 Then
Select Case Message
Case "gow ef"
If BotInChat = 1 Then
WriteToFile "c:\nnCron\gowef.sem", ""
AddQ Username & " requested gow ef, join"
AddQ "/w " & Username & " please, whisper 'start' when ready, autostart in 2 min"
CheckAction 30000, "PlayersWaiting"
IsInGame = 4
BotInChat = 0
GameOwner = Username
Else
AddQ "/w " & Username & " please, wait GameBot on channel"
End If
Case "gow f"
If BotInChat = 1 Then
WriteToFile "c:\nnCron\gowf.sem", ""
AddQ Username & " requested gow f, join"
AddQ "/w " & Username & " please, whisper 'start' when ready, autostart in 2 min"
CheckAction 30000, "PlayersWaiting"
IsInGame = 4
BotInChat = 0
GameOwner = Username
Else
AddQ "/w " & Username & " please, wait GameBot on channel"
End If
Case "chop"
If BotInChat = 1 Then
WriteToFile "c:\nnCron\chop.sem", ""
AddQ Username & " requested chop, join"
AddQ "/w " & Username & " please, whisper 'start' when ready, autostart in 2 min"
CheckAction 30000, "PlayersWaiting"
IsInGame = 4
BotInChat = 0
GameOwner = Username
Else
AddQ "/w " & Username & " please, wait GameBot on channel"
End If
Case "start"
If IsInGame > 0 Then
Select Case Username
Case GameOwner
AddQ "/w " & Username & " starting game now"
WriteToFile "c:\nnCron\gamestep1nc.sem", "" ' start, without cancel if failed
CreateFile "c:\nnCron\mute.sem"
Case Else
AddQ "/w " & Username & " you are not game owner to start it"
End Select
Else
AddQ "/w " & Username & " game is not requested, nothing to start"
End If
Case "resetwar2"
Log "User " & Username & " restarted war2"
TimerCheckAction.Enabled = False
WriteToFile "c:\nnCron\resetwar2.sem", ""
Init
Case Else
AddQ "/w " & Username & " Please type 'gow ef', 'gow f' or 'chop'"
End Select
Else ' BotInWork=1
AddQ "/w " & Username & " Sorry, bot in work, try later"
End If ' BotInWork
End Sub
' ----------------- bot joins channel -------------------------
Sub il_Event_UserJoins(Username, Flags, Message, Ping, Product, Level, OriginalStatString, Banned)
Select Case Username
Case "GameBot"
BotInChat = 1
If IsFirstJoin = 1 Then
' WriteToFile "c:\nnCron\echo.sem", "/away Whisper to 'bot', please, I just create games, I'm a host bot"
IsFirstJoin = 0
TimerCheckAction.Enabled = False
Log "Timer stopped: " & CheckActionAction
Else
TimerCheckAction.Enabled = False
IsInGame = 0
DeleteFile "c:\nnCron\mute.sem"
Log "Timer stopped: " & CheckActionAction
End If
' AddQ Username & " joined channel"
End Select
End Sub
' ----------------- bot leaves channel ------------------------
Sub il_Event_UserLeaves(Username, Flags)
Select Case Username
Case "GameBot"
If BotInChat <> 0 Then
TimerCheckAction.Enabled = False
CheckAction 30000, "UserLeavesNoReason"
Log "User leaved with no reason, timer started"
End If
BotInChat = 0
' AddQ Username & " leaved channel"
End Select
End Sub
' ----------------- start system ------------------------------
Sub il_Event_LoggedOn(Username, Product)
If BotInWork = 0 Then
WriteToFile "c:\nnCron\startwar2.sem", ""
Init
End If ' BotInWork
End Sub
nncron script:
# *
# * Copyright (C) 2015 il
# *
# * This program is free software; you can redistribute it and/or
# * modify it under the terms of the GNU General Public License
# * as published by the Free Software Foundation; either version 2
# * of the License, or (at your option) any later version.
# *
# * This program is distributed in the hope that it will be useful,
# * but WITHOUT ANY WARRANTY; without even the implied warranty of
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# * GNU General Public License for more details.
# *
# * You should have received a copy of the GNU General Public License
# * along with this program; if not, write to the Free Software
# * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#CRONTAB FILE
# Classic crontab format:
# Minutes Hours Days Months WeekDays Years Command
# see 'example.tab'
#( purge-cron-log
Time: 0 12 * * 5 *
Action: PURGE-OLD: "log\*.log" 7
)#
#( mainsection
VARIABLE SEM1 \ semaphore - 1 object - transaction for several clicks or keys
: Click ( x y -- ) \ click to x y coords
MOUSE-MOVE
MOUSE-LBCLK
\ 1000 PAUSE \ wait 1 second
;
: enter_chat ( )
SEM1 GET
1000 PAUSE
425 25 Click
2000 PAUSE
SEND-KEYS: "{ENTER}{DELAY 2000}{ENTER}{DELAY 200}m{DELAY 200}e{DELAY 1000}c{DELAY 3000}pAsSwOrD12{DELAY 200}GameBot{ENTER}"
5000 PAUSE
SEND-KEYS: "/away Whisper to 'bot', please, I just create games, I'm a host bot{ENTER}"
SEM1 RELEASE
;
: create_game ( gamename -- )
SEM1 GET
CASE
1 OF \ 1=gowef
SEND-KEYS: "@c{DELAY 1000}gow ef " \ create name browse classic gow
10 RANDOM N>S SEND-KEYS \ name + random digit
SEND-KEYS: "@b{DELAY 200}c{ENTER}{DELAY 200}g{ENTER}{DELAY 200}" \ browse classic gow
SEND-KEYS: "@t{DELAY 200}{DOWN}{UP}{UP}{UP}{UP}{UP}{UP}{DOWN}{ENTER}" \ type melee
SEND-KEYS: "@s{DELAY 200}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{LEFT}" \ speed ef
SEND-KEYS: "@r{DELAY 200}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{ENTER}" \ res high
SEND-KEYS: "@i{DELAY 200}{DOWN}{UP}{UP}{UP}{UP}{UP}{ENTER}" \ tileset default
SEND-KEYS: "{ENTER}" \ ok
ENDOF
2 OF \ 2=gowf
SEND-KEYS: "@c{DELAY 1000}gow f " \ create name browse classic gow
10 RANDOM N>S SEND-KEYS \ name + random digit
SEND-KEYS: "@b{DELAY 200}l{ENTER}{DELAY 200}g{ENTER}{DELAY 200}" \ browse ladder gowbne
SEND-KEYS: "@t{DELAY 200}{DOWN}{UP}{UP}{UP}{UP}{UP}{UP}{DOWN}{ENTER}" \ type melee
SEND-KEYS: "@s{DELAY 200}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}" \ speed f
SEND-KEYS: "@r{DELAY 200}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{ENTER}" \ res high
SEND-KEYS: "@i{DELAY 200}{DOWN}{UP}{UP}{UP}{UP}{UP}{ENTER}" \ tileset default
SEND-KEYS: "{ENTER}" \ ok
ENDOF
3 OF \ 3=chop
SEND-KEYS: "@c{DELAY 1000}chop " \ create name browse classic gow
10 RANDOM N>S SEND-KEYS \ name + random digit
SEND-KEYS: "@b{DELAY 200}o{ENTER}{DELAY 200}c{ENTER}{DELAY 200}" \ browse other chopfarms
SEND-KEYS: "@t{DELAY 200}{DOWN}{UP}{UP}{UP}{UP}{UP}{UP}{DOWN}{DOWN}{DOWN}{DOWN}{ENTER}" \ type mapdef
SEND-KEYS: "@s{DELAY 200}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}" \ speed f
SEND-KEYS: "@r{DELAY 200}{DOWN}{UP}{UP}{UP}{UP}{ENTER}" \ res default
SEND-KEYS: "@i{DELAY 200}{DOWN}{UP}{UP}{UP}{UP}{UP}{ENTER}" \ tileset default
SEND-KEYS: "{ENTER}" \ ok
ENDOF
ENDCASE
SEM1 RELEASE
;
: gamestep4 ( )
SEM1 GET
FILE-EXIST: "c:\nnCron\mute.sem" IF
EXIT
THEN
SEND-KEYS-DELAY: 20 0
SEND-KEYS: "The game will be autostarted in 1.5 min{ENTER}"
200 PAUSE
SEND-KEYS: "I will leave after game start, i'm host bot{ENTER}"
SEM1 RELEASE
;
: gamestep3 ( )
SEM1 GET
FILE-EXIST: "c:\nnCron\mute.sem" IF
EXIT
THEN
SEND-KEYS-DELAY: 20 0
SEND-KEYS: "The game will be autostarted in 1 min{ENTER}"
200 PAUSE
SEND-KEYS: "I will leave after game start, i'm host bot{ENTER}"
SEM1 RELEASE
;
: gamestep2 ( )
SEM1 GET
FILE-EXIST: "c:\nnCron\mute.sem" IF
EXIT
THEN
SEND-KEYS-DELAY: 20 0
SEND-KEYS: "The game will be autostarted in 30 sec{ENTER}"
200 PAUSE
SEND-KEYS: "I will leave after game start, I'm host bot{ENTER}"
SEM1 RELEASE
;
: gamestep1nc ( )
SEM1 GET
SEND-KEYS-DELAY: 20 0
SEND-KEYS: "@o{DELAY 200}{ENTER}" \ ok and close the msgbox if appeared
10000 PAUSE
10 10 Click
SEND-KEYS: "{DELAY 200}e{DELAY 200}q{DELAY 200}q{DELAY 200}{BS}{BS}{BS}{DELAY 5000}{ENTER}" \ exit the game if started or del eqq if not
SEM1 RELEASE
;
: gamestep1 ( ) \ force exit if unable to start
SEM1 GET
SEND-KEYS-DELAY: 20 0
SEND-KEYS: "@o{DELAY 200}{ENTER}" \ ok and close the msgbox if appeared
10000 PAUSE
10 10 Click
SEND-KEYS: "{DELAY 200}e{DELAY 200}q{DELAY 200}q{DELAY 5000}{ENTER}" \ exit the game if started or del eqq if not
SEND-KEYS: "{DELAY 2000}@c{DELAY 200}{ESC}" \ cancel game creation if no players joined
SEM1 RELEASE
;
\ RunOnce
NoDel
Time: 0 0 21 5 * 2009
\ WatchHotKey: "^1"
Action:
)#
#( startwar2
NoDel
SingleInstance
WatchFile: "c:\nnCron\startwar2.sem"
Action:
enter_chat
)#
#( resetwar2
NoDel
SingleInstance
WatchFile: "c:\nnCron\resetwar2.sem"
Action:
SEM1 GET
KILL: "Warcraft II BNE.exe"
3000 PAUSE
SEM1 RELEASE
enter_chat
)#
#( gowef
NoDel
SingleInstance
WatchFile: "c:\nnCron\gowef.sem"
Action:
1 create_game
)#
#( gowf
NoDel
SingleInstance
WatchFile: "c:\nnCron\gowf.sem"
Action:
2 create_game
)#
#( chop
NoDel
SingleInstance
WatchFile: "c:\nnCron\chop.sem"
Action:
3 create_game
)#
#( gamestep1nc_a
NoDel
WatchFile: "c:\nnCron\gamestep1nc.sem"
Action:
gamestep1nc
)#
#( gamestep1_a
NoDel
SingleInstance
WatchFile: "c:\nnCron\gamestep1.sem"
Action:
gamestep1
)#
#( gamestep2_a
NoDel
SingleInstance
WatchFile: "c:\nnCron\gamestep2.sem"
Action:
gamestep2
)#
#( gamestep3_a
NoDel
SingleInstance
WatchFile: "c:\nnCron\gamestep3.sem"
Action:
gamestep3
)#
#( gamestep4_a
NoDel
WatchFile: "c:\nnCron\gamestep4.sem"
Action:
gamestep4
)#
#( echo
NoDel
SingleInstance
WatchFile: "c:\nnCron\echo.sem"
Action:
SEM1 GET
SEND-KEYS: "{DELAY 200}"
' SEND-KEYS: "/w il "
' S" c:\nnCron\echo.sem" FILE + 0 SEND-KEYS
SEM1 RELEASE
)#
Fell free to ask any questions about that project if you want to implement it.