Jump to content

Recommended Posts

Posted

So I was wondering if it's possible to make my $button1 start a functin when it's pressed?

So, basicly I got a whole lot of code, but I do not have an GUI for it. So I decided to create a GUI for it, but now I do not know how to make my Button actually execute the script.

Here is the GUI code:

#include <NomadMemory.au3>

#include <ButtonConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Form1", 625, 443, 192, 124)

$Label1 = GUICtrlCreateLabel("Label1", 8, 32, 84, 25)

$Label2 = GUICtrlCreateLabel("Label2", 8, 104, 84, 33)

$Button1 = GUICtrlCreateButton("Start Bot", 8, 360, 257, 57, $WS_GROUP)

GUISetState(@SW_SHOW)

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

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

After this I created a "func _start()" right before my code, and right after I put EndFunc, so how do I start the "_start()" function by pressing the button on my GUI? :x

Thanks in advance. If anything was hard to understand,just say, and ill try to elaborate. Was quite hard to explain this when I do not really know what everything is called :P

  • Moderators
Posted

xCynic,

  Quote

Start Bot

Please read this. :P

The answer to your question can be found on the <GUI Reference - MessageLoop Mode> page of the Help file. You might find the excellent tutorials that you will find here and here useful as well. :x

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

  On 1/12/2011 at 8:48 PM, 'Melba23 said:

xCynic,

Please read this. :shifty:

The answer to your question can be found on the <GUI Reference - MessageLoop Mode> page of the Help file. You might find the excellent tutorials that you will find here and here useful as well. :x

M23

The bot dosn't necessarily have to be for an online game now does it? :P

Thanks for your answer tho ^^

Posted (edited)

  On 1/12/2011 at 8:49 PM, 'Varian said:

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            _Start()
    EndSwitch
WEnd

Thanks, ill try it, got no clue what it does tho :3

EDIT: Awesome, it worked. <3

Edited by xCynic
Posted

  On 1/12/2011 at 8:59 PM, 'ZacUSNYR said:

Good luck with that Microsoft Word bot you were working on :x

Actually it's a friend of mine who requested me to create a spam bot for him (MSN). Nudge spam, Message Spam, and to Steal the other persons information (your MSN status will be the exact same as the other persons), allthough, I don't think I'm able to do the last one just yet.

Posted

Got a new problem now tho. Is there anyway to check if a certain process is running? I got this "WinWaitActive", but I want it to clearly state on the *bot* if the process is not running. Like "Waiting for MSN to start" and when the program finds MSN's process this text will dissapear?

Posted

  On 1/12/2011 at 9:10 PM, 'xCynic said:

Actually it's a friend of mine who requested me to create a spam bot for him (MSN). Nudge spam, Message Spam, and to Steal the other persons information (your MSN status will be the exact same as the other persons), allthough, I don't think I'm able to do the last one just yet.

In the Name of all that is Holy, please NEVER say anything like that on a public forum again. You are inviting a world of hurt on yourself!!!!
Posted (edited)

  On 1/12/2011 at 9:14 PM, 'Varian said:

In the Name of all that is Holy, please NEVER say anything like that on a public forum again. You are inviting a world of hurt on yourself!!!!

Did not know that a MSN *bot* was against the rules. In that case, it won't happen again..

Just out of curiosity, why is this against the rules(?), all I'm trying to do here is learn the language :3 + Can't come up with a good idea for a script to make, seems quite lame to create a script that opens Chrome and searches for something random ;o

+In the announcement, it was only stated that one may not talk about automating games. And in my head, MSN isn't really a game, is it? :x

Edited by xCynic
  • Developers
Posted (edited)

  On 1/12/2011 at 9:39 PM, 'xCynic said:

Did not know that a MSN *bot* was against the rules. In that case, it won't happen again..

Just out of curiosity, why is this against the rules(?), all I'm trying to do here is learn the language :3 + Can't come up with a good idea for a script to make, seems quite lame to create a script that opens Chrome and searches for something random ;o

Yea right, you are just stupid and can't think of any reason why we do not want any of this shit discussed here?

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

  On 1/12/2011 at 9:10 PM, 'xCynic said:

Steal the other persons information (your MSN status will be the exact same as the other persons)

That part may be considered criminal impersonation, keyword "criminal", aka identity theft
Posted

  On 1/12/2011 at 9:43 PM, 'Jos said:

Yea right, you are just stupid and can't think of any reason why we do not want any of this shit discussed here?

Jos

Temper FTW. Would have been better if you just told me that it's against the rules, but no.. Here we have to go on and get pissed off. I'm just looking for help and an explanation. And no actually, I can't come up with a good reason why this would not be discussed.. But nvm, I see this forum dosn't really feel the urge to help, nor be polite. So I will take my "shit" and go somewhere else..

Posted

  On 1/12/2011 at 9:50 PM, 'Varian said:

That part may be considered criminal impersonation, keyword "criminal", aka identity theft

Let me rephrase.

The only thing that will happen, is that your Name (That you can change at any given time) will be changed to the other persons name. This is not considered an criminal act, sorry for my bad description earlier.

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...