Sign in to follow this  
Followers 0
xation

Sending variables

7 posts in this topic

Hey there guys, I need help with a few things in my script.

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

HotKeySet("{Esc}", "Terminate")

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 150, 150, 150, 100)
$Input = GUICtrlCreateInput("", 20, 20, 100, 30)
$button = GUICtrlCreateButton("Start", 50, 50, 50, 50)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $button
            iMacro()

    EndSwitch
WEnd

Func Pwn()
    ToolTip("To stop/pause bot, click the autoit icon on the taskbar [blue circle with triangle in middle]", 150, 150)
    Sleep(3000)
    ToolTip("")
    StartPwnage()
EndFunc  

;starts script
Func StartPwnage()
    WinMinimizeAll()
    Run("My program here")
    TimeOut1()
    Diskunekt()
EndFunc   ;==>StartPwnage

;omg disconnect lol
Func Diskunekt()
    For $triez = 1 To 10
        ToolTip("DIS1 ", 600, 100, "Action:")
        Dim $diskunekt = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 13959168)
        If Not @error Then
            MouseClick("left", $diskunekt[0], $diskunekt[1], 1, 0)
            Sleep(1000)
            Diskunekt2()
        EndIf
        Sleep(1000)
    Next
    ToolTip("DIS1FAIL", 600, 100, "Action:")
    Sleep(5000)
    StartPwnage()
EndFunc   ;==>Diskunekt

Func Diskunekt2()
    For $triez2 = 1 To 10
        ToolTip("DIS", 600, 100, "Action:")
        Dim $diskunekt = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 13959168)
        If Not @error Then
            MouseClick("left", $diskunekt[0], $diskunekt[1], 1, 0)
            Sleep(1000)
            Rekunekt()
        EndIf
        Sleep(1000)
    Next
    ToolTip("DIS FAIL", 600, 100, "Action:")
    Sleep(5000)
    StartPwnage()
EndFunc   ;==>Diskunekt2

;rekonekt bruh

Func Rekunekt()
    ToolTip("REK.", 600, 100, "Action:")
    Dim $rekunekt = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0x61c400)
    If Not @error Then
        MouseClick("left", $rekunekt[0], $rekunekt[1], 1, 0)
        Goto()






    EndIf

EndFunc   ;==>Rekunekt

Func Goto()
    ToolTip("GOTO", 600, 100, "Action")
    ToolTip("Sleeping for " & 7 & " seconds")
    Sleep(1000)
    ToolTip("Sleeping for " & 6 & " seconds")
    Sleep(1000)
    ToolTip("Sleeping for " & 5 & " seconds")
    Sleep(1000)
    ToolTip("Sleeping for " & 4 & " seconds")
    Sleep(1000)
    ToolTip("Sleeping for " & 3 & " seconds")
    Sleep(1000)
    ToolTip("Sleeping for " & 2 & " seconds")
    Sleep(1000)
    ToolTip("Sleeping for " & 1 & " seconds")
    Sleep(1000)
    ToolTip("Starting")
    iMacro()

EndFunc   ;==>Goto

Func iMacro()

    ToolTip("STARTING ", 600, 100, "Action:")
    MouseClick("left",1394, 49, 1, 0)
    Sleep(1000)
    WinWaitActive("chrome-ex", "", 10)
    If Not @error Then
        Send("{TAB}")
        Sleep(1000)
        Send("{ENTER}")
        Dim $STARTLEET = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0x019cff)
        MouseClick("left", 60, 309, 1, 0)
        Sleep(2000)
        WinMove("chrome-", "", 200, 200)
        Sleep(3000)
        ToolTip("Sleeping")
        MouseClick("left", 72, 210, 1,0)
        Sleep(1000)
        Sleep(3000)
        MouseClick("left", 387, 258, 1, 0)
        GUICtrlRead($Input)
        Send($Input)
        Sleep(1000)
        Send("{TAB}")
        Send("{TAB}")
        Send("{ESC}")
    EndIf
EndFunc   ;==>iMacro



Func TimeOut1()
    ToolTip("Wating for Chrome Window", 600, 100, "Action:")
    $timeout1 = WinWaitActive("Hotspot", "", 60)
    If $timeout1 = 0 Then
        ToolTip("Restarting", 600, 100, "Action:")
        Pwn()
    EndIf
    If $timeout1 = 1 Then
        Opt("SendKeyDelay", 500)
        Send("!{SPACE}")
        Send("x")
    EndIf
    ToolTip("")
EndFunc   ;==>TimeOut1

Func Terminate()
    Exit
EndFunc   ;==>Terminate

Alright... I firstly need help with my sending in my

Func iMacro()

    ToolTip("STARTING ", 600, 100, "Action:")
    MouseClick("left",1394, 49, 1, 0)
    Sleep(1000)
    WinWaitActive("chrome-ex", "", 10)
    If Not @error Then
        Send("{TAB}")
        Sleep(1000)
        Send("{ENTER}")
        Dim $STARTLEET = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0x019cff)
        MouseClick("left", 60, 309, 1, 0)
        Sleep(2000)
        WinMove("chrome-", "", 200, 200)
        Sleep(3000)
        ToolTip("Sleeping")
        MouseClick("left", 72, 210, 1,0)
        Sleep(1000)
        Sleep(3000)
        MouseClick("left", 387, 258, 1, 0)
        GUICtrlRead($Input)
        Send($Input)
        Sleep(1000)
        Send("{TAB}")
        Send("{TAB}")
        Send("{ESC}")
    EndIf
EndFunc   ;==>iMacro

What's wrong here? I can't seem to figure out how to send $input (A user created number/letter sequence in my gui, from GUICtrlCreateInput) into a form in my google chrome browser. I tried everything, making $input a global variable, GUICtrlRead, raw Send() command, but still, this is giving me two numbers in particular, 4 and 6. This is not the number I entered.

My second issue is With the Goto() func, I remember there was a way to make it less of a script and it would count from X amount of time to X amount of time.

Thanks guys

Share this post


Link to post
Share on other sites



ToolTip("To stop/pause bot, click (...)

REPORT!

Share this post


Link to post
Share on other sites

@xation,

Have you read the sticky at the top of the support forums about BOTS?

REPORT!

Lets not go overboard on this. Fine to report Bots threads but also pls explain the why because with a 99.999999% chance the OP haven't read the sticky.

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Isn't everything on here a bot? Everything automates tasks, this is NOT a game bot, this is used as a program to automate tasks in an IE browser, I HAVE read the sticky. This is not a game, the rules spesificly say

Do not discuss automating games here. It doesn't matter if the game is a single player game, multi-player game or game you've written yourself, do not discuss the automation of games here. The previous rule about game automation discussions was ambiguous and too many people tried the "but I'll only use it in single player" excuse for games that have single and multiplayer components. No more.

DO NOT DISCUSS GAME AUTOMATION HERE.

This bot uses a google chrome browser

Share this post


Link to post
Share on other sites

This bot uses a google chrome browser

... doesn't prove anything now does it?

anyway, you already got the benefit of the doubt or else the topic would have been closed...so relax.


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

As for sending variables you would need to define them some how, so for example we'll use an input box.

$Input1 = InputBox("Title Goes Here", "Please Input the variable you want to pass to the web browser.", "", "", 375, 125)

Now that you have your variable from the Input box you can use:

WinActivate("Google Chrome")

MouseClick....

Send("" & $Input1 & "")

This code won't work for you but it is an example of how to Send a Variable. You just need to figure out how you're going to define it, InputBox, INI file, Temporary File, etc. For some reason I can't use code tags or anything my web browser isn't registering them so all your code appears jammed together.

/Edit: Sorry didn't see you were using a GUI.

Edited by BlackDawn187

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Soo... any other replies? I still need help with this. Need to be able for a user to input their own 6 digit code of numbers in the GUI and have the window pass them on to the web browser.

Edit / No longer need help, Didn't understand the InputBox at first, but now it's all good. Thanks guys.

Edited by xation

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