Jump to content

Spask

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by Spask

  1. I'm trying to create a script that would send a message through facebook messenger invisibly. It should happen in the background without interfering with other windows. I will be logged into facebook already, so the login will be done manually. The only way I know of to automate this is by activating the window and sending simulated keystrokes, but the window needs to be active for that. I've also looked in the HTML to try to do it through that, but I wasn't able to find anything useful. How would I do this? Is it even possible?
  2. Woops my bad, didn't realize I made another post.
  3. Sure, here it is: $ie = ObjCreate("InternetExplorer.Application") #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $bot = GUICreate("Bot", 226, 139, -1, -1) Global $startie = GUICtrlCreateButton("Start IE", 32, 24, 155, 25) Global $startloop = GUICtrlCreateButton("Start Loop", 32, 56, 75, 25) Global $pauseloop = GUICtrlCreateButton("Pause Loop", 112, 56, 75, 25) GUICtrlSetOnEvent($startie, 'StartIE') GUICtrlSetOnEvent($startloop, 'startloop') GUICtrlSetOnEvent($pauseloop, 'Pauseloop') GUISetOnEvent($GUI_EVENT_CLOSE, 'ExitApp') Opt('GUIOnEventMode', 1) GUISetState(@SW_SHOW) Global $var = 0 ;function to start internet explorer and get website ready Func StartIE() With $ie .visible = true .navigate("http://cleverbot.com") While($ie.busy) Sleep(500) WEnd EndWith EndFunc While 1 With $ie ;while loop to interact with the website While $var = 1 While($ie.busy) Sleep(500) WEnd Sleep(5000) $sayitbutton = .document.getElementsByTagName("input") For $b in $sayitbutton if $b.value = "think for me" Then $b.click() EndIf Next ;finds the text in html $span = .document.getElementsByTagName("span") For $text In $span If $text.value = " " Then Sleep(50) MsgBox(0,0,0) ;messagebox to test if it can be found, but I don't know how to grab the text EndIf Next WEnd EndWith WEnd ;starts the loop Func startloop() $var = 1 EndFunc ;pauses the loop Func Pauseloop() $var = 2 EndFunc ;exits the app Func ExitApp() Opt('GUIOnEventMode', 0) GUIDelete($bot) Exit EndFunc
  4. Does this work if I'm trying to do it in an IE window? I've created a variable called $ie = ObjCreate("InternetExplorer.Application")
  5. Hi, I'm trying to find a text value inside of a html. This is what the line looks like normally: <p id="line1" class> <span class="bot">TEXT HERE</span> </p> The text then changes to a non breaking space: <p id="line1" class> <span class="bot">&nbsp;</span> </p> And then it changes back to normal text but it's different every time. Can I code this so that it grabs the text every time it changes and has a variable that represents it? I currently have this inside of my loop: $span = .document.getElementsByTagName("span") For $text In $span If $text.value = "&nbsp;" Then Sleep(50) MsgBox(0,0,0) ;messagebox to test if it can be found, but I don't know how to grab the text EndIf Next The problem is that there are many other lines in the html that have the same span but are called "line3", "line5", etc and the one I need is from "line1". I will appreciate if anyone can help with this!
  6. Thank you!
  7. Hi, I've made a script with a while loop in it but I can't figure out how to stop the loop while it's running. $np = Run("notepad.exe") #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $bot = GUICreate("AutoIT bot", 226, 126, -1, -1) Global $startloop = GUICtrlCreateButton("Start Loop", 32, 56, 75, 25) Global $pauseloop = GUICtrlCreateButton("Pause Loop", 112, 56, 75, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Global $var = 1 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit ;starts loop Case $startloop startloop() ;should Pause loop, but does not work Case $pauseloop Pauseloop() EndSwitch WEnd Func startloop() $var = 1 WinActivate ("untitled") While $var = 1 Send("test") Send("{ENTER}") WEnd EndFunc Func Pauseloop() $var = 2 EndFunc The while loop starts at line 36
  8. Thanks, it worked. I wanted to have a text field in my GUI but the normal textbox doesn't have that many options so I wanted to embed a notepad window. But is it possible to have them both active? So notepad could act like a text box in the GUI instead of another window.
  9. Hello, how can I embed a notepad window in my GUI? $np = Run("notepad.exe") #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= Global $bot = GUICreate("AutoIT bot", 226, 126, -1, -1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
×
×
  • Create New...