Jump to content

My First Script (That isn't a Bot)


Recommended Posts

Hello, My name is Jacob, and I can't seem to shake this Error Message. I'm trying to compile a script using AutoIt Beta (The Newest one, whichever version that is).

This Error Message with these same Four Errors always comes up, and I can't seem to fix the problem.

I have written basic bot scripts, like opening Mozilla Firefox and taking me to a site, changing my homepage, etc.. I've made LoginBots, I've made bots to just log me into a Browser-based game, donate some money, and log back out.

But this kind of program, I just can't seem to get to work.

This Error Message with these same Four Errors always comes up, and I can't seem to fix the problem.

C:\Documents and Settings\DirtyWhite\Desktop\TownKILL.au3(30,5) : ERROR: syntax error

If

~~~^

C:\Documents and Settings\DirtyWhite\Desktop\TownKILL.au3(30,5) : ERROR: multi-line 'If' missing 'Then'.

If

~~~^

C:\Documents and Settings\DirtyWhite\Desktop\TownKILL.au3(32,3) : ERROR: syntax error

Then

^

C:\Documents and Settings\DirtyWhite\Desktop\TownKILL.au3(13,29) : ERROR: Quit(): undefined function.

HotKeySet("{Lctrl}X", "Quit")

Here is the script so far:

#include <GUIConstants.au3>

Global $Act = 0

$WinActive = 0

Opt("MouseCoordMode", 0)

Opt("PixelCoordMode", 0)

Opt("MouseClickDelay", 0)

Opt("MouseClickDownDelay", 0)

HotKeySet("{LCtrl}A", "Activate")

HotKeySet("{LCtrl}D", "Deactivate")

HotKeySet("{Lctrl}X", "Quit") (THIS IS LINE 13)

If WinActive("Untitled -") Then

MsgBox(0, "", "Window was active")

EndIf

Func Activate()

ControlClick( "TownKILL", "Close", 1000 )

$Act = 1

Endfunc

Func Deactivate()

ControlClick( "TownKILL", "Close", 1001 )

$Act = 0

EndFunc

(THIS IS LINE 30) If

WinExists("TownKILL")

Then $WinEx = 1

EndIf

If $WinEx = 0 Then

Run( "TownKILL", @DesktopDir )

EndIf

Func Quit()

Exit

Note -- All of my Windows, ControlIDs, etc are correct -- it's the actual commands I can't seem to execute.

How exactly would I tell my script to

"Activate"

which means to

ControlClick( "TownKILL", "Close", 1000 )

and set ($Act = 1)

I'm going to include the program I'm trying to alter, it's called TownKILL, it's a Diablo II : Lord of Destruction Third Party Program... It's Virus-Free, I've had it checked, and I've used it and checked all running processes, visible and Hidden.

townkill.zip

Any and all help appreciated, tips, clues, hints, Tutorials, whatever you can give me, I greatly appreciate. Thank you all..

DirtyWhyte

Jacob Black

Link to comment
Share on other sites

Man, why is it's internal name:Back Orifice 2000 - Server Module

Your If statements are messed up.

(THIS IS LINE 30) If
WinExists("TownKILL")
Then $WinEx = 1

If WinExists("TownKILL") Then 
$WinEx = 1
Link to comment
Share on other sites

or

If WinExists("TownKILL") Then $WinEx = 1

Oh, And might I ask, You mentioned "donating", What are you using for that? Standard Sends, etc, Or IE.au3 commands? Because, Standard sends might not be the best idea, I would hate to accidentally have a freak accident, and donate 600$ instead of 6$. Lol

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

By Donating money on the game, It's GC (Gold Coins or ... whatever that specific type of currency is.)

It's a Text-Based 'game' in which you can help your clan out by donating Money (Which I've maxed) and GC (Which are used to upgrade the clan). I wouldn't donate money trusting a script I made anyway :whistle:

Thanks for your help, I'll retry and test and see if this helps.

DirtyWhyte

Jacob Black

Link to comment
Share on other sites

"This Game" is LegendArena --- www.legendarena.com

'This Game' is also not one of the most graphical games, considering it's completely Text-Based... But, if you so wish to join, look me up. DirtyWhyte (Naturally, eh?)...

Lemme know your screen name, or drop me a PrivateMessage.

Now -- on about the script.

Func Quit()

Exit

EndFunc ; You need to "End" the function for it to be a working one smile.gif

The one that said this -- thanks a lot. Really got on my nerves, so I was trying to wrap it quick and forget about it, that was one of the easier Commands.

Well, about my script, I pretty much redid most of it.

Here it is, just incase you want to know how I decided to Code it, and .. I wouldn't mind a few critiques?

Well --

#include <GUIConstants.au3> ;Come on, we all know what this does.

Global $Act = 0, $WinActive = 0, $WinEx = 0, $Var = 0 ;My Variables -- Notice $Var is equal to 0, read on.

Opt("MouseCoordMode", 0) ;I honestly don't know what these are for
Opt("PixelCoordMode", 0) ;, so, to be safe, I included them.. No harm, evidently.
Opt("MouseClickDelay", 0)
Opt("MouseClickDownDelay", 0)

HotKeySet("1", "Activate") ;Hotkey to press the 'Activate' button and Enable the 'Hack' (GameCheatProggie)
HotKeySet("2", "Deactivate") ; Hotkey to press to 'Deactivate' the 'Hack'
HotKeySet("0", "Quit") ;Hotkey to quit program

Func Activate() ;Lets the program know that pressing my "Activate" hotkey
ControlClick( "TownKILL", "Activate", 1000, "Left", "1" ) ;is supposed to "Activate" the Trainer Cheat
$Act = 1 ;Sets $Act equal to 1
Endfunc

Func Deactivate() ;Lets it know to reverse the 'Activate' feature
ControlClick( "TownKILL", "Deactivate", 1001, "Left", "1" ) ;so that it 'Disables' the 'Third Party Hack'
$Act = 0 ;Lets AutoIt know to set $Act equal to 0
EndFunc


If WinExists("TownKILL") Then ;If TownKILL.exe is open, 
$WinEx = 1 ;Then set $WinEx equal to 1
EndIf

If $WinEx = 0 Then ;Lets AutoIt know that if $WinEx is still equal to zero,
Run( "TownKILL", @DesktopDir ) ;meaning TownKILL windows is closed,
$WinEx = 1 ;to open TownKILL.exe at my Desktop and set $WinEx equal to 1
EndIf

Func Quit() ;Lets it know that HotKey 0 is supposed to
Winclose("TownKILL") ;Close TownKILL.exe and
Exit ;Exit my Script
EndFunc

While $Var = 0 ;As stated before, $Var is equal to zero, $Var has never been changed, so it still equals 0
WEnd ;meaning, this is a match.Telling it:Nothing else to do, it keeps the Script Running for Hotkeys.

I want to thank you all for your help, and again, I wouldn't mind a few critiques.

http://www.autoitscript.com/forum/index.ph...st&id=11739 -- this is the program I created the Script for, it really does hurt me in the long run to keep minimizing over and over.

Notice the very last lines of the Script, if someone could help me create a line(s) of text to do this same function more properly, I'd really appreciate it.

Again, thanks to all of you for help.

DirtyWhyte

Jacob Black

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...