Jump to content

Scripting Problems


Recommended Posts

I'm trying to make a script that sends back what people spam on a instant messaging tool called Xfire. Everyday I get someone that sends a message like rent a server for blah blah a month and I keep asking he/she to stop. But they don't, so that is why I am trying to make this script.

There are a few problems with the script and I can't find the reason why. Does anyone see what is wrong?

#include <GUIConstants.au3>
$Form1 = GUICreate("Xfire Spammer", 406, 322, 203, 125)
GUICtrlCreateLabel("Hit Start and then as quickly as possible click in the Xfire Send message box.", 16, 8, 376, 17)
$Button1 = GUICtrlCreateButton("&Start", 16, 32, 89, 25)
$Button2 = GUICtrlCreateButton("&About", 304, 32, 89, 25)
$Input1 = GUICtrlCreateEdit("Delete this message and replace it with the spammers message." & @CRLF & "Press the End key to stop spamming.", 8, 72, 385, 237, -1)
GUISetState(@SW_SHOW)

$var1 = 1
Dim $message
HotKeySet("{DELETE}","Xfire")
HotKeySet("{END}","Stop")

While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
        Case $Button1
            Xfire()
        Case $Button2
        WEnd
        Exit


Func Xfire()
Sleep (6000)
Do
    ClipPut("$message")
    send("{enter}")
    Sleep (10)
    Until $var1 = 0
    EndFunc

Func Stop()
    $var1 = 0
EndFunc
Link to comment
Share on other sites

try this for a select...case... function

While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button1
            Xfire()
    Case $msg = $Button2
           msgbox(0,"About","about")
    Case Else
         ;;;;
   EndSelect
WEnd
Exit
Edited by jinxter

> there are 10 types of people in the world, those who understand binary and those who don't.

Link to comment
Share on other sites

the easiest way is to make a msgbox(). plain and simple.

another way is to use GUISetState() to show or hide the various windows. In which case it could be wise to use GUIOnEventMode() like this... (not the prettiest of code, but you should get the general idea)

#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1)
$MainWindow = GUICreate("Xfire Spammer", 406, 322, 203, 125)
GUICtrlCreateLabel("Hit Start and then as quickly as possible click in the Xfire Send message box.", 16, 8, 376, 17)
$Button1 = GUICtrlCreateButton("&Start", 16, 32, 89, 25)
$Button2 = GUICtrlCreateButton("&About", 304, 32, 89, 25)
$Input1 = GUICtrlCreateEdit("Delete this message and replace it with the spammers message." & @CRLF & "Press the End key to stop spamming.", 8, 72, 385, 237, -1)
GUICtrlSetOnEvent($Button1, "_start")
GUICtrlSetOnEvent($Button2, "_about")
GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")

$AboutWindow = GUICreate("about", 100, 100)
$AboutOKButton = GUICtrlCreateButton("&Ok", 16, 32, 89, 25)
GUICtrlSetOnEvent($AboutOKButton, "_exitabout")

GUISwitch($mainwindow)
GUISetState(@SW_SHOW)

While 1
    sleep(1000)
WEnd

func _about()
    GUISwitch($AboutWindow)
    GUISetState(@SW_SHOW)
EndFunc

func _start()
    ;;;
EndFunc

func _exitabout()
    GUISetState(@SW_HIDE)
    GUISwitch($mainwindow)
EndFunc
    
func _exit()
    Exit
EndFunc
Edited by jinxter

> there are 10 types of people in the world, those who understand binary and those who don't.

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