K3STROS

Help, Acting up

2 posts in this topic

Not too sure what i havent done properly at this point i have been going over it for a while. I'm also new to this. I want when i click a button on the "Settings" GUI ex. The first button, i want it to open a MsgBox(0), which it already does but then it does not give me any time to click a location to record my XY coordinates into the variable.

#include <AutoItConstants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <MsgBoxConstants.au3>

HotKeySet('{ESC}', "Terminate")

Global $Point = MouseGetPos()
Global $xyTEL1
Global $xyBOOTEL2
Global $xyITM
Global $xyEMPINV
Global $xyCLOBAN
Global $xyBox1
Global $xyBox2
Global $xyBox5


#Region ### START Koda GUI section ###

$Start_Exit_GUI = GUICreate("----", 228, 194, 398, 222) ; Opens GUI with start/exit buttons
GUISetBkColor(0x0000FF)

$Start_Botton = GUICtrlCreateButton("START", 0, 0, 227, 89, $WS_GROUP) ; Start button
GUICtrlSetFont(-1, 28, 400, 0, "Absolute Zero")
GUICtrlSetColor(-1, 0xFF00FF)
GUICtrlSetBkColor(-1, 0x00FF00)

$Exit_Button = GUICtrlCreateButton("EXIT", 0, 96, 227, 97, $WS_GROUP) ; Exit butto
GUICtrlSetFont(-1, 28, 400, 0, "Absolute Zero")
GUICtrlSetColor(-1, 0xFFFF00)
GUICtrlSetBkColor(-1, 0xFF0000)

$ExitLabel = GUICtrlCreateLabel("ESC", 100, 160, 26, 26)
GUICtrlSetFont(-1, 14, 800, 0, "Times New Roman")
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0xFF0000)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

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

        Case $Start_Botton ; What happens when Start button is clicked
            Settings()

        Case $Exit_Button ; What happens when Exit or F2 button is clicked/pressed
            Terminate()

    EndSwitch
WEnd


Func Settings()

$Settings = GUICreate("SETTINGS", 436, 315, 271, 221)
GUISetBkColor(0x0000FF)
$Settings_Label1 = GUICtrlCreateLabel("Since this is Beta0.1 Things have to be set manually.", 0, 0, 429, 26)
GUICtrlSetFont(-1, 14, 800, 0, "Times New Roman")
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xFF00FF)
$Setting_Label2 = GUICtrlCreateLabel("Simply follow the prompts", 106, 32, 216, 26)
GUICtrlSetFont(-1, 14, 800, 0, "Times New Roman")
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xFF00FF)
$Settings_BUTBAN = GUICtrlCreateButton("----", 160, 104, 121, 33, $WS_GROUP)
$Settings_BUTITE = GUICtrlCreateButton("----", 160, 144, 121, 33, $WS_GROUP)
$Settings_BUTEMP = GUICtrlCreateButton("----", 160, 184, 121, 33, $WS_GROUP)
$Setting_BUTINVTAB = GUICtrlCreateButton("----", 160, 64, 121, 33, $WS_GROUP)
$Settings_BUTX = GUICtrlCreateButton("----", 160, 224, 121, 33, $WS_GROUP)
$Setting_Button_Start = GUICtrlCreateButton("----", 184, 288, 75, 25, $WS_GROUP)
GUISetState(@SW_SHOW)

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

        Case $Settings_BUTBAN
            T1_Button()

        Case $Settings_BUTITE
            ITELOC_Button()

        Case $Settings_BUTEMP
            EMPINV_Button()

        Case $Setting_BUTINVTAB
            SelectInvBoxes()

        Case $Settings_BUTX
            CLOINV_Button()

;       Case $Setting_Button_Start ;;NO CODE
;           Start()   

    EndSwitch
WEnd


EndFunc

Func Terminate()
    Exit 1
EndFunc

Func Start()
    While 1

    Call(BankTeller())
        Sleep (Random (90,200,1))

    Call(EmptyInventory())
        Sleep (Random (90,200,1))

    Call(TakeAskesBones())
        Sleep (Random (90,200,1))

    Call(CloseInventory())
        Sleep (Random (90,200,1))

    Call(SpreadBury())
         Sleep (Random (90,200,1))

    WEnd

EndFunc


Func T1_Button()

    MsgBox(0, "----", "----")

    $xyTEL1 = MouseGetPos()

    MsgBox(0, "----","----")

    Call(T2)

EndFunc

Func T2()

    MsgBox(0, "----" "----")

    $xyBOOTEL2 = MouseGetPos()

    MsgBox(0, "----", "----")

EndFunc

Func ITELOC_Button()

    MsgBox(0, "----" "----")

    $xyITM = MouseGetPos()

    MsgBox(0, "----", "----")

EndFunc


Func EMPINV_Button()

    MsgBox(0, "----", "----")

    $xyEMPINV = MouseGetPos()

    MsgBox(0, "----","----")

EndFunc


Func CLOINV_Button()

    MsgBox(0, "----", "----")

    $xyCLOBAN = MouseGetPos() ; Sets the position for the X  to close your bank

    MsgBox(0, "----", "----")

EndFunc


Func SELINVBOX_Button()

    MsgBox(16, "----", "----")

    Call(INVBOX1_POS())

    Call(INVBOX2_POS())

    Call(INVBOX3_POS())

EndFunc


Func INVBOX1_POS()

    MsgBox(0, "----", "----")

    $xyBox1 = MouseGetPos()

    MsgBox(0, "----", "----")

EndFunc


Func INVBOX2_POS()

    MsgBox(0, "----", "----")

    $xyBox2 = MouseGetPos()

    MsgBox(0, "----", "----")

EndFunc


Func INVBOX3_POS()

    MsgBox(0, "----", "----")

    $xyBox5 = MouseGetPos()

    MsgBox(0, "----", "----")

EndFunc

 

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

It is hard to help address your "specific" symptom when the code that you posted is not runnable...

edit: If you are trying to automate a Web page or app then there may be better alternatives than mouseclick...

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

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

  • Similar Content

    • StudioMaker
      By StudioMaker
      Hey anyone knows how i can have a inputbox that is connected to an HotKeySet? Like if u put in like "a" in the inputbox it sets the hotkey to "a"?
       
    • gononono64
      By gononono64
      Hey there,
      I'm having some issues quick-sorting my 2d array imported from a database. Im trying to sort the array based on the name that would be returned in $array[$n][2]. The code i posted works for smaller arrays but for some reason when i try to sort my imported array (around 9000 indexes), I get "Recursion level has been exceeded". I understand that this is maybe due to lack of returns but i couldn't find an ideal spot to stick em and again it seems to work with smaller bits of code. Could it be that 9000 is too much?
      I would normally just trial and error it until i figured it out but due to the length of time to load and buffer my array it's become too time consuming. Really I'm just hoping there is a quick fix that someone with more experience happens to know.
      Thank you
       
      ;;---------------------------------------------This Works---------------------------------------------------- Local $a[7][2] = [ _ ["1", "asdfashks"], _ ["2", "SubStrlkghjing1"], _ ["3", "jdfghjsergh"], _ ["4", "nertynert"], _ ["5", "cvbncvjkrt"], _ ["6", "avbncvjkrt"], _ ["7", "oytuoyuop"]] Quicksort($a,1,0,6) _ArrayDisplay($a) ;;------------------------------------------This Does Not--------------------------------------------------------- Quicksort($aLargeData, 1, 0, Ubound($aLargeData) - 1) _ArrayDisplay($aLargeData) ;;----------------------------------------Quicksort Function------------------------------------------------------ Func Quicksort(ByRef $Array, $secondIndex, $First, $Last) Local $pivot, $i, $j, $temp If $First < $Last Then $pivot = $First $i = $First $j = $Last While ($i < $j) While (StringCompare($Array[$i][$secondIndex], $Array[$pivot][$secondIndex]) <= 0) And ($i < $Last) $i += 1 WEnd While (StringCompare($Array[$j][$secondIndex], $Array[$pivot][$secondIndex]) > 0) $j -= 1 WEnd If ($i < $j) Then _ArraySwap($Array, $i, $j) _ArraySwap($Array,$pivot,$j) Quicksort($Array, $secondIndex, $First,$j-1) Quicksort($Array, $secondIndex, $j+1,$Last) WEnd EndIf EndFunc  
    • RyukShini
      By RyukShini
      I was wondering if its possible to make anything like this in AutoIT

       
      function toArr(str) { var ret = Array((str.length + 3) >> 2); // String to array of 32 bit ints for (var i = 0; i < str.length; i += 4) { // FYI: // NaN << x === 0 // x | NaN === x ret[i >> 2] = (str.charCodeAt(i ) << 24) | (str.charCodeAt(i+1) << 16) | (str.charCodeAt(i+2) << 8) | str.charCodeAt(i+3); } return ret; } function megaKdf(pw) { var pwkey = [0x93c467e3, 0x7db0c7a4, 0xd1be3f81, 0x0152cb56]; var arrPw = toArr(pw); var aes = Array((arrPw + 3) >> 2); // Init aes keys for (var i = 0; i < arrPw.length; i += 4) { aes[i >> 2] = new sjcl.cipher.aes([arrPw[i]|0, arrPw[i+1]|0, arrPw[i+2]|0, arrPw[i+3]|0]); } // Generate password key for (var i = 0; i < 65536; i++) { for (var j = 0; j < aes.length; j++) { pwkey = aes[j].encrypt(pwkey); } } return pwkey; } function loginHash(pwKey, email) { var aes = new sjcl.cipher.aes(pwKey); var arrEmail = toArr(email); var hash = [0, 0, 0, 0]; // Compress email with xor for (var i = 0; i < arrEmail.length; i++) { hash[i & 3] ^= arrEmail[i]; } // Generate hash for (var i = 0; i < 16384; i++) { hash = aes.encrypt(hash); } return sjcl.codec.base64.fromBits([hash[0], hash[2]], true, true); } function badRand32() { return Math.floor(0x100000000 * Math.random()); } function generateMasterKey() { return [badRand32(), badRand32(), badRand32(), badRand32()]; } function confirmationLinkHash(pwKey) { var aes = new sjcl.cipher.aes(pwKey); return aes.encrypt([badRand32(), 0, 0, badRand32()]); } function updateHashes(email, pw) { var pwKey = megaKdf(pw); var masterKey = generateMasterKey(); var clHash = confirmationLinkHash(pwKey, masterKey); var lHash = loginHash(pwKey, email); var aes = new sjcl.cipher.aes(pwKey); return lHash; } function htmlentities(str) { return str.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;"); } function analyzeLink(link, pw) { var linkHex = "N/A"; var masterKey = "N/A"; var encMasterKey = "N/A"; var pwHash = "N/A"; var unknown = "N/A"; var email = "N/A"; var spacer = "N/A"; var name = "N/A"; var unknown2 = "N/A"; if (link.substr(0, 27) == "https://mega.co.nz/#confirm") { link = link.substr(27); } if (link.substr(0, 19) == "mega.co.nz/#confirm") { link = link.substr(19); } if (link.substr(0, 8) == "#confirm") { link = link.substr(8); } if (link.search(/^[0-9A-Za-z\-_]*$/) == 0) { link = sjcl.codec.hex.fromBits(sjcl.codec.base64.toBits(link, true)); var pos; for (pos = 94; pos < link.length; pos += 2) { if (link.substr(pos, 2) == "09") { break; } } if (pos < link.length) { var pwKey = megaKdf(pw); var aes = new sjcl.cipher.aes(pwKey); var linkHash = aes.decrypt(sjcl.codec.hex.toBits(link.substr(32, 32))); if (linkHash[1] == 0 && linkHash[2] == 0) { masterKey = (new sjcl.cipher.aes(pwKey)).decrypt(sjcl.codec.hex.toBits(link.substr(0, 32))); masterKey = 'Base64: <span style="color:#f00; font-family:monospace;">' + sjcl.codec.base64.fromBits(masterKey, true, true) + '</span> (hex: <span style="color:#f00; font-family:monospace;">' + sjcl.codec.hex.fromBits(masterKey) + '</span>)'; } else if (pw != "") { masterKey = "Wrong password"; } encMasterKey = '<span style="color:#f00; font-family:monospace;">' + link.substr( 0, 32) + '</span>'; pwHash = '<span style="color:#080; font-family:monospace;">' + link.substr(32, 32) + '</span>'; unknown = '<span style="color:#00f; font-family:monospace;">' + link.substr(64, 30) + '</span>'; email = link.substr(94, pos - 94); spacer = '<span style="color:#0cc; font-family:monospace;">09</span>'; name = link.substr(pos + 2, link.length - 16 - pos - 2); unknown2 = '<span style="color:#000; font-family:monospace;">' + link.substr(link.length - 16) + '</span>'; linkHex = '<span style="font-family:monospace;">' + encMasterKey + " " + pwHash + " " + unknown + ' <span style="color:#888; font-family:monospace;">' + email + '</span> ' + spacer + ' <span style="color:#f0f; font-family:monospace;">' + name + '</span> ' + unknown2 + '</span>'; email = htmlentities(sjcl.codec.utf8String.fromBits(sjcl.codec.hex.toBits(email))) + ' (<span style="color:#888; font-family:monospace;">' + email + '</span>)'; name = htmlentities(sjcl.codec.utf8String.fromBits(sjcl.codec.hex.toBits(name))) + ' (<span style="color:#f0f; font-family:monospace;">' + name + '</span>)'; } } ge("linkHex").innerHTML = linkHex; ge("linkMasterKey").innerHTML = masterKey; ge("linkEncMasterKey").innerHTML = encMasterKey; ge("linkPwHash").innerHTML = pwHash; ge("linkUnknown").innerHTML = unknown; ge("linkEmail").innerHTML = email; ge("linkSpacer").innerHTML = spacer; ge("linkName").innerHTML = name; ge("linkUnknown2").innerHTML = unknown2; }  
    • barkeeper
      By barkeeper
      Hi there, not sure if this is the right place, but I'm building a script for using premade answers in chat. It works and outputs the answers (stored in an ini file based on:  answer name = answer it also works with a new line if there is a tag <enter> in the answer text in the ini file. Now the problem is, that after the answer is pasted in the chat (you bring up the interface with ctrl+1) it gives an enter, thus sending the output straight away. I would like to be able to review the answer before sending it. can anyone help me by telling what's wrong in the script, I tried replacing the @crlf in the script with other options, no luck. Thanks in advance! 
      antwoorden.au3
      antwoorden.ini
    • Mungo
      By Mungo
      After an update installation to Win 10 V.1607 (64bit) I have noticed that help does not show formatted properly anymore e.g. with Images missing, tables, headers, sample code mal formatted etc.

      However, if AutoIt3Help.exe is run as Administrator everything works fine.

      I have already uninstalled AutoIt and SciTE for AutoIt and reinstalled both in the latest version.  I have used default locations for the installation under:


      C:\Program Files (x86)\AutoIt3\...
      Any idea?

      Thanks