Sign in to follow this  
Followers 0
Delta01

GuiInputBox, wont send value

3 posts in this topic

#1 ·  Posted (edited)

Hey,

I'm trying to make a simple message sender for a game, to stop me having to type repetitively.

I made a GUI and created some input boxes, I can get the script to read the input boxes, so that if they equal the default then the script won't send anything.

However, when I want it to send the message that I have entered into the input box, it just sends the number 3.

My code is as follows.

Global $Paused = 0
HotKeySet("{F5}", "Togglepause")

GuiCreate("BooYA's Spammer", 265, 450)
$Line1 = GuiCtrlCreateInput("What you wish to spam. Line 1", 10, 55)
$Line2 = GuiCtrlCreateInput("What you wish to spam. Line 2", 10, 85)
$Line3 = GuiCtrlCreateInput("What you wish to spam. Line 3", 10, 115)
$Line4 = GuiCtrlCreateInput("What you wish to spam. Line 4", 10, 145)
$Line5 = GuiCtrlCreateInput("What you wish to spam. Line 5", 10, 175)
$Start = GuiCtrlCreateButton("Start", 20, 275, 100, 35)
$Pause = GuiCtrlCreateButton("Pause", 125, 275, 100, 35)
$Sleep = GuiCtrlCreateInPut("1000", 10, 230, 50, 20)
GuiCtrlCreateLabel("Sleep time inbetween messages, in miliseconds", 10, 205)
GuiCtrlCreateLabel("Enter what you wish to spam below."  & @CRLF & "If you don't want to use all lines, leave them blank", 10, 10)
GuiCtrlCreateLabel("Made by BooYA©", 175, 435)
GuiCtrlCreateLabel("Instructions: Run Silkroad, login then load the script." & @CRLF &  "Fill in the boxes. Click on the chat box. Press F5" & @CRLF & "to unpause the script." & @CRLF &  "If you want to edit what you spam, please pause" & @CRLF &  "the script first.", 10, 330)
GuiSetState()

TogglePause()

While 1
    $msg = GuiGetMsg()
    $Read1 = GuiCtrlRead($Line1)
    
    If $Read1 = "What you wish to spam. Line 1" Then
            sleep(10)
        Else 
            Send($Line1)
            sleep($Sleep)
            send("{ENTER}")
            EndIf
        
                        WEND


Func TogglePause()
$Paused = Not $Paused
While $Paused
Sleep(500)
ToolTip("Booya's Spammer is paused - Press F5 to resume",1,1)
WEnd
ToolTip("")
EndFunc

Does anybody know what's wrong?

Alot of the things in the GUI have no value at the moment. It's not finished, i just need to know how to get the sending to work.

Thanks

Edited by Delta01

Share this post


Link to post
Share on other sites



I believe...

Replace Send($Line1) with Send(GUICtrlRead($Line1))

Share this post


Link to post
Share on other sites

Ahhhhhh. That's what was wrong!

Thanks

Share this post


Link to post
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
Sign in to follow this  
Followers 0