Jump to content

Finally released Src... :P


Recommended Posts

My cousin plays this game, It's text based, a MUD or something. And he said he would buy me a carton of Doral if I managed to create a program that automates his game. So... I am 20 packs happier, and I am releasing the code... :P

You will Notice '***' all over the place, those are identifiable triggers or names that could relate this project to the MUD owners... I would'nt wanna get his character banned... :P The actual end result has been torn all to hell... As you can obviously see... I just got it working like it's supposed to, and I have not had the chance to review and remove tid-bits of garbage... Any suggestions or ideas would be appreciated. I know that the AutoIt forum does not condone, nor appreciate the use of AutoIt to automate games and such. But please keep in Mind, I will do what I can to make ends meet. I take NO pride in being the ruler in a game in which I cheated in, and neglating the fact I havn't played a REAL game since QuakeII... So please don't flame me because this is automating a game. I want to personally thank all those who contributed! Especially Frank10 for the badass GUI and info, also to DaveF for contributing a small chunk of a big help, and MikeHunt114!. I have learned the usage of AutoIt in less than a month, I can now (on my own)... Do almost ANYTHING in AutoIt! :) All thanks to you guys. I would like to admit that of Visual Basic, Python, Lua, etc... That AutoIt is my favorite language! I will always be here on the forums ghosting from one topic to another... waiting for a new release... :P

P.S. Did I remember to add that YES, I know that code is butchered...lol... Any sugestions would be great!

EDIT - Updated the src, from like 127 lines to 239 - EDIT

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=DW(07-26-07) BETA.Exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_UseAnsi=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstants.au3>
#include <array.au3>

TCPStartup()

$router_IP = "***"
$port = "***"

Dim $ConnectedSocket = -1
$ConnectedSocket = TCPConnect($router_IP , $port )
If $ConnectedSocket = -1 Then
    MsgBox(16, "Error", "Server" & $router_IP & " seems to be down...")
    Exit
EndIf
HotKeySet("{F6}", "Inputt")
HotKeySet("{F7}", "StandAloneInput")
$GOOEY = GUICreate("*** Bot",800,600)
$edit = GUICtrlCreateEdit("",10,50,750,550,$WS_DISABLED)
GUICtrlSetBkColor($edit,0x000000)
GUICtrlSetFont ($edit,12)
GUISetState()
Dim $recv
Dim $sMovee[304]=["s","s","se","e","s","se","sw","s","se","sw","sw","s","s","se","se","e","se","e","e","e","e","e","e","e","ne","n","n","n","n","n","ne","n","n","e","e","e","e","e","ne","n","ne","ne","n","n","ne","ne","n","n","n","n","n","nw","nw","nw","w","nw","w","nw","w","w","nw","nw","w","w","s","s","s","s","se","e","se","s","s","s","sw","s","sw","w","sw","s","w","w","nw","nw","w","nw","nw","n","n","n","w","w","s","w","nw","s","s","se","s","s","s","s","se","e","e","se","s","s","se","s","ne","e","e","se","e","e","ne","e","e","e","ne","n","n","nw","w","n","w","s","w","n","w","ne","ne","n","e","ne","ne","n","n","n","nw","nw","n","w","nw","w","n","n","e","e","se","se","sw","se","e","se","e","s","s","s","se","e","e","e","ne","n","n","nw","nw","w","nw","w","nw","w","w","sw","w","nw","w","s","s","w","w","w","sw","s","sw","s","se","e","w","nw","n","ne","n","ne","e","e","e","se","e","se","s","s","s","sw","s","sw","w","sw","s","w","w","nw","nw","w","nw","nw","n","n","n","w","w","s","w","nw","s","s","se","s","s","s","s","s","s","se","e","s","se","sw","s","se","ne","e","se","se","ne","ne","e","e","se","se","ne","n","n","e","e","ne","ne","n","ne","ne","nw","nw","e","ne","ne","n","n","n","n","nw","nw","w","s","s","s","se","s","sw","s","s","w","w","w","sw","w","sw","w","sw","w","w","w","w","w","w","nw","w","w","nw"]
$iCounter = 0
$evil = "no"
$StandAlone = InputBox("Stand Alone?", "Do You wish to use this connection as a StandAlone? Yes = No triggers, Bot is Inactive")
Func StandAloneInput()
$hehe = InputBox("BinaryBrother", "Input Command.")
        TCPSend( $ConnectedSocket , $hehe & @CRLF)
        StandAlone()
EndFunc
Func StandAlone()
While 1
    $recv = TCPRecv($ConnectedSocket,9999)
       If $recv <> "" Then
        GUICtrlSetData($edit, $recv & @CRLF & GUICtrlRead($edit))
    EndIf
WEnd
EndFunc
While 1
    $kills = 0
    $timerrr = TimerInit()
    $majorme = TimerInit()
    $recv = TCPRecv($ConnectedSocket,9999)
       If $recv <> "" Then
        GUICtrlSetData($edit, $recv & @CRLF & GUICtrlRead($edit))
        sleep(2000)
    EndIf
If StringInStr($recv,"Your choice:") Then
    TCPSend( $ConnectedSocket , "Binary" & @CRLF)
    sleep(4000)
    TCPSend( $ConnectedSocket , "***" & @CRLF)
EndIf

If StringInStr($recv,"Throw the other copy out?") Then
    msgbox(4096, "ERROR", "You did not log out correctly last time. This program will now attempt to kick the net dead copy from the game.")
    GUICtrlSetData($edit, "Please Wait...")
    TCPSend( $ConnectedSocket , "y" & @CRLF)
    sleep(5000)
    LookForKill2()
EndIf
If StringInStr($recv,"This is the Rimwards Gate of Sto Lat, ") Then
    GUICtrlSetData($edit, "Bot is Active, Location Check 1 of 2 passed.")
    TCPSend( $ConnectedSocket , "look" & @CRLF)
    sleep(3000)
EndIf

If StringInStr($recv,"There are five obvious exits: southeast, north, south, southwest and west.") Then
    GUICtrlSetData($edit, "Location Check 2 of 2 passed. You are in the correct Starting location!!")
    sleep(5000)
    TCPSend( $ConnectedSocket , "qwho" & @CRLF)
    sleep(Random(2000,5000))
    TCPSend( $ConnectedSocket , "major me" & @CRLF)
    GUICtrlSetData($edit, "Setting off some IDLE")
    sleep(Random(30000, 40000))
    GUICtrlSetData($edit, "Creating group and inviting parties.")
    TCPSend( $ConnectedSocket , "gcc" & @CRLF)
    sleep(Random(2000,3000))
    TCPSend( $ConnectedSocket , "gfa" & @CRLF)
    sleep(Random(10000,20000))
    GUICtrlSetData($edit, "Bot will now Begin Sto Lat Wall")
    sleep(2000)
    GUICtrlSetData($edit, "Created and Designed by BinaryBrother")
    sleep(5000)
    GUICtrlSetData($edit, "Idea, support, and creativity by: Xanadoo, and those on the AutoIt Forum")
    sleep(5000)
If StringInStr($StandAlone,"yes") or StringInStr($StandAlone,"Yes") Then
    StandAloneInput()
Else
    LookForKill2()
EndIf
EndIf
WEnd
Func LookForKill2()
    TCPSend( $ConnectedSocket , "look" & @CRLF)
    sleep(Random(2000,3000))
    LookForKill()
EndFunc
Func LookForKill()
While 1
$recv = TCPRecv($ConnectedSocket,9999)
If $recv <> "" Then
    GUICtrlSetData($edit, $recv & @CRLF & GUICtrlRead($edit))
EndIf
If StringInStr($recv,"It leads from the busiest gate, lying to the northwest, ") then
    $iCounter = 1
    TCPSend($ConnectedSocket,"nw")
    TCPSend($ConnectedSocket,"s")
EndIf
If StringInStr($recv, "Something.  It's dark here, isn't it?") Then
        TCPSend($ConnectedSocket,"light weapon 1" & @CRLF)
        sleep(12000)
EndIf
If StringInStr($recv,"What?") Or StringInStr($recv,"Try something else.") Then
    MsgBox(4096, "CRASH", "What? or Try something else. has been triggered...")
    Run("notepad.exe")
    WinActivate("Untitled")
    WinWait("Untitled")
    ClipPut($recv)
    Send("^v")
    Send($kills)
    OnAutoItExit()
EndIF
If StringInStr($recv,"Binary has no arcane") Or StringInStr($recv, "divine protection expires") Or StringInStr($recv,"divine protection is weakening") Then
    TCPSend( $ConnectedSocket , "major me" & @CRLF)
sleep(12000)
EndIf
If StringInStr($recv,"too evil for") Then
    $evil = "yes"
EndIf
If StringInStr($recv,"It leads from the busiest gate, lying to the northwest, ") then
    $iCounter = 1
    TCPSend($ConnectedSocket,"nw")
    TCPSend($ConnectedSocket,"s")
EndIf
If StringInStr($recv,"pigeon is pottering") Or StringInStr($recv,"priest are standing") Or StringInStr($recv,"priest is stansing") Or StringInStr($recv,"tosher are standing") Or StringInStr($recv,"tosher is standing") Or StringInStr($recv,"worker is standing") Or StringInStr($recv,"worker are standing") Or StringInStr($recv,"tanner is standing") Or StringInStr($recv,"tanner are standing") Or StringInStr($recv, "carpenter are standing") Or StringInStr($recv, "carpenter is standing") Or StringInStr($recv, "vintner are standing") Or StringInStr($recv, "vintner is standing") Or StringInStr($recv,"tanner are standing") Or StringInStr($recv,"jester is standing") Or StringInStr($recv,"jester are standing") Or StringInStr($recv,"seller is standing") or StringInStr($recv,"judge are standing") or StringInStr($recv,"judge is standing") or StringInStr($recv,"florist is standing") Or StringInStr($recv,"florist are standing") Or StringInStr($recv,"terrier is standing") Or StringInStr($recv,"merchant is standing") Or StringInStr($recv,"child are standing") Or StringInStr($recv,"bum is standing") Or StringInStr($recv,"thief are standing") Or StringInStr($recv,"warrior is standing") Or StringInStr($recv,"thief is standing") Or StringInStr($recv,"peasant are standing") Or StringInStr($recv,"drunk are standing") Or StringInStr($recv,"peasant is standing") Or StringInStr($recv,"washerwoman is standing") Or StringInStr($recv,"washerwoman are standing") Or StringInStr($recv,"drunk is standing") Or StringInStr($recv,"brawler are standing") Or StringInStr($recv,"child is standing") Or StringInStr($recv,"brawler is standing") Or StringInStr($recv,"drunk is sitting") Or StringInStr($recv,"deerhound is standing") Or StringInStr($recv,"spaniel are standing") Or StringInStr($recv,"bum are standing") Or StringInStr($recv,"carter are standing") Or StringInStr($recv,"spaniel is standing here") Or StringInStr($recv,"nobleman are standing") Or StringInStr($recv,"wolfhound is standing") Or StringInStr($recv,"fishmonger are") Or StringInStr($recv,"dressmaker are") Or StringInStr($recv,"carter is standing") Or StringInStr($recv,"executioner is standing") Or StringInStr($recv,"drunk is lying") Or StringInStr($recv,"warrior are standing") Or StringInStr($recv,"girl is standing") Or StringInStr($recv,"man is standing") Or StringInStr($recv,"judge is standing") Or StringInStr($recv,"hound are standing") Or StringInStr($recv,"worker is taking") Or StringInStr($recv,"worker is slouching") Or StringInStr($recv,"worker is running") Or StringInStr($recv,"chandler is standing") Or StringInStr($recv,"seller are standing") Or StringInStr($recv,"dog are standing") Or StringInStr($recv,"drover are standing") Or StringInStr($recv,"lipwigzer are standing") Or StringInStr($recv,"noblewoman are standing") Or StringInStr($recv,"retriever are standing") Or StringInStr($recv,"hound are standing") Or StringInStr($recv,"man are standing") Or StringInStr($recv,"merchant are standing") Or StringInStr($recv,"butcher are standing") Or StringInStr($recv,"beggar are standing")Or StringInStr($recv,"beggar is standing") Or StringInStr($recv,"beggar is sitting") Or StringInStr($recv,"terrier are standing") Or StringInStr($recv,"deerhound are standing") Or StringInStr($recv,"nobleman is standing") Or StringInStr($recv,"wolfhound are standing") Or StringInStr($recv,"fishmonger is standing") Or StringInStr($recv,"dressmaker is standing") Or StringInStr($recv,"executioner are standing") Or StringInStr($recv,"girl are standing") Or StringInStr($recv,"chandler are standing") Or StringInStr($recv,"dog is standing") Or StringInStr($recv,"drover is standing") Or StringInStr($recv,"lipwigzer is standing") Or StringInStr($recv,"noblewoman is standing") Or StringInStr($recv,"retriever is standing") Or StringInStr($recv,"hound is standing")Or StringInStr($recv,"butcher is standing") Or StringInStr($recv,"cur is standing") Or StringInStr($recv,"cur are standing") Or StringInStr($recv,"beagle is standing") Or StringInStr($recv,"beagle are standing") Then
    sleep(Random(1000,2000))
    TCPSend( $ConnectedSocket , "ka" & @CRLF)
    $kills += 1
    $timerrr = TimerInit()
    $recv = 0
    KillIt()
Else
    TCPSend( $ConnectedSocket , $sMovee[$iCounter] & @CRLF)
    $iCounter += 1
    $recv = 0
    sleep(Random(2000,3000))

EndIf
WEnd
EndFunc
Func KillIt()
Do
$recv = TCPRecv($ConnectedSocket,9999)
If $recv <> "" Then
    GUICtrlSetData($edit, $recv & @CRLF & GUICtrlRead($edit))
EndIf
If StringInStr($recv,"It leads from the busiest gate, lying to the northwest, ") then
    $iCounter = 1
    TCPSend($ConnectedSocket,"nw")
    TCPSend($ConnectedSocket,"s")
EndIf
$defff = TimerDiff($timerrr)
$majortime = TimerDiff($majorme)
If $defff > 60000 Then
    TCPSend($ConnectedSocket , "major me" & @CRLF)
    TCPSend($ConnectedSocket , "/" & @CRLF)
    LookForKill2()
EndIf
If $majortime > 600000 Then
    TCPSend($ConnectedSocket , "major me" & @CRLF)
    $majorme = TimerInit()
    sleep(12000)
EndIf
If StringInStr($recv,"Binary has no arcane") Or StringInStr($recv, "divine protection expires") Or StringInStr($recv,"divine protection is weakening") Then
    TCPSend( $ConnectedSocket , "major me" & @CRLF)
sleep(12000)
EndIf
If StringInStr($recv, "Cannot find") Then
        TCPSend( $ConnectedSocket , $sMovee[$iCounter] & @CRLF)
        $iCounter += 1
        LookForKill2()
EndIf
Until StringInStr($recv,"You killed") Or StringInStr($recv,"dealt the death")
TCPSend( $ConnectedSocket , "look" & @CRLF)
sleep(Random(2000,3000))
$recv = TCPRecv($ConnectedSocket,9999)
If $sMovee[$iCounter] = 300 then
    $iCounter = 1
    TCPSend($ConnectedSocket,"nw")
    TCPSend($ConnectedSocket,"s")
EndIf
If $recv <> "" Then
    GUICtrlSetData($edit, " > " & $recv & @CRLF & GUICtrlRead($edit))
EndIf
    If StringInStr($recv, "are fighting") Or StringInStr($recv, "is fighting") Then
        $recv = 0
        KillIt()
    EndIf
        If StringInStr($evil,"yes") Then
            $evil = 0
        TCPSend( $ConnectedSocket , "decompose corpse 1" & @CRLF)
        $recv = 0
        Sleep(Random(1000,2000))
        LookForKill2()
        Else
        TCPSend( $ConnectedSocket , "/" & @CRLF)
        $recv = 0
        sleep(Random(1000,2000))
        LookForKill2()
EndIf
EndFunc
Func Inputt()
        GUICtrlSetData($edit, "You can now input a command to the game!!")
$hehe = InputBox("Command", "Command here")
        TCPSend( $ConnectedSocket , $hehe & @CRLF)
LookForKill2()
EndFunc

Func OnAutoItExit()
    If $ConnectedSocket <> - 1 Then
        sleep(2000)
        TCPCloseSocket($ConnectedSocket)
    EndIf
    sleep(1000)
    TCPShutdown()
msgbox(4096,"Kills",$kills)
    Run("notepad.exe")
    WinActivate("Untitled")
    WinWait("Untitled")
    ClipPut($recv)
    Send("^v")
    Send($kills)
EndFunc
Edited by BinaryBrother

SIGNATURE_0X800007D NOT FOUND

Link to comment
Share on other sites

Shouldn't this be in Example scripts?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Shouldn't this be in Example scripts?

Post count = 14 right now. If he didn't have enough posts yet, he couldn't post to Examples.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Martin, Volly... Incase you have not noticed... This script needs some general support. Prohibited in the Example partition of this Forum. Says so in bright colorful text in the header... :)

Posted Image

But being as the fact were all more worried about where the post should go... I guess this will work....

Still any ideas or suggestions would be much appreciated. I honestly hope everyone isn't mad because it's automation/gameside.

Edited by BinaryBrother

SIGNATURE_0X800007D NOT FOUND

Link to comment
Share on other sites

Apparently.... I was wrong...

Anyways, I'm fixing to throw

If StringInStr($recv, "trigger") Or StringInStr($recv, "trigger 2")oÝ÷ Ú)í¡©À®¶²jëh×6Local $iMax
Local $i
Local $data="trigger1|trigger2"
Local $arr = StringSplit($data, "|")  
If StringInStr($recv,$arr[$i]) Then 
    For $i = 1 to $arr[0]
       ;statements
EndIf

I'm currently reading, http://www.autoitscript.com/wiki/index.php?title=Arrays . So be patient... :)

Edited by BinaryBrother

SIGNATURE_0X800007D NOT FOUND

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...