Sign in to follow this  
Followers 0
Sepz

help for a coding newb :\

13 posts in this topic

k, im trying to make a bot that presses 1 button over and over.

the catch is, i need it to keep the window that its pressing the buttons in minimized. so i can press the button, and surf the web at the same time XD. its for a game called silkroad.

heres what i have so far.

$sTitle = "Gaia (New) - TIGGOBITTIES"

WinWait($sTitle)

$hWin = WinGetHandle($sTitle)

$buff1 = ControlSend($hWin, "", "", 1)

While 1=1

if $buff1 then

ControlSend($hWin, "", "", 1)

endif

Send ( "1" )

ControlSend($buff1, "", "", 1)

sleep(2000)

Wend

like i said im VERY new at this, infact i dont really know what im doing at all XD. i got the idea from this post http://sawboo.com/macrome/?p=18 , and just deleted/modified code to make it work (kinda LOL)

i thought "hey, if this guy can make something like that, i can too... i was wrong, but maybe u guys can help me :).

like i said, it switches to the window, and starts pressing the button. but i need it to be minimized the whole time, thanks guys

Share this post


Link to post
Share on other sites



cmon i know one of u knows... its almost all here, i just cant figure out why it wont do it while minimized >.<

btw i know im not supposed to bump for 24 hours, but i made this thread in the middle of the night lol

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

First of all, welcome to AutoIt forums :)

2nd, Send() Function use like this: Send ("{1}"), not Send ( "1" )...

3rd, here is a little demo script, maybe can help you, I don't understand very well what do you want exactly (I'm bad in English :))

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$pressed = 0
$Form1 = GUICreate("Gaia (New) - TIGGOBITTIES", 242, 90, -1, -1)
$Button1 = GUICtrlCreateButton("Buff", 17, 16, 207, 57, 0)
GUISetState(@SW_SHOW)

While 1
    ControlClick($sTitle, "", "Button1")

    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $pressed += 1
            TrayTip("Test", "Button pressed "& $pressed & " times...", 5 ,1)
            Sleep(1000)
    EndSwitch
WEnd
Edited by n3nE

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites

I forgot, for minimizing, with this you can minimize that window:

Local $hWnd = WinGetHandle("[CLASS:Notepad]");from help scripts...
Local $sHWND = String($hWnd)   ; Convert to a string
WinSetState(HWnd($sHWND), "", @SW_MINIMIZE)

Just use AutoIt help...


[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites

i dont need it to automatically minimize, i just need it to send the commands to that window while its minimized. so it doesnt come back up while its pressing the button... i compiled what u gave me, and it still requires the window to be selected for it to press the button, i cant think of anything else, it should work the way i have it, but it doesnt... any ideas?

thanks

Share this post


Link to post
Share on other sites

anyone? lol i really need this working asap

Share this post


Link to post
Share on other sites

sooo, i been trying on and off for about a week now to get this to work, just for fun, i tried to get it to press 1 in notepad while the window was minimized, no luck LOL im horrible. any other ideas?

Share this post


Link to post
Share on other sites

i still have a problem getting commands/keys to go to a minimized window, any ideas?

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

ControlSend("Untitled", "", "Edit1", "This is a line of text in the notepad window")

title The title of the window to access. 
text The text of the window to access. 
controlID The control to interact with. See Controls. 
string String of characters to send to the control. 
flag [optional] Changes how "keys" is processed:
  flag = 0 (default), Text contains special characters like + to indicate SHIFT and {LEFT} to indicate left arrow.
  flag = 1, keys are sent raw.
Edited by walle

Share this post


Link to post
Share on other sites

k, im trying to make a bot that presses 1 button over and over.

the catch is, i need it to keep the window that its pressing the buttons in minimized. so i can press the button, and surf the web at the same time XD. its for a game called silkroad.

heres what i have so far.

$sTitle = "Gaia (New) - TIGGOBITTIES"

WinWait($sTitle)

$hWin = WinGetHandle($sTitle)

$buff1 = ControlSend($hWin, "", "", 1)

While 1=1

if $buff1 then

ControlSend($hWin, "", "", 1)

endif

Send ( "1" )

ControlSend($buff1, "", "", 1)

sleep(2000)

Wend

like i said im VERY new at this, infact i dont really know what im doing at all XD. i got the idea from this post http://sawboo.com/macrome/?p=18 , and just deleted/modified code to make it work (kinda LOL)

i thought "hey, if this guy can make something like that, i can too... i was wrong, but maybe u guys can help me :).

like i said, it switches to the window, and starts pressing the button. but i need it to be minimized the whole time, thanks guys

If you want to send a "1" keypress to Gaia you can do it with a controlsend()

Something like this " ControlSend("Gaia (New)","","","1") - This is off the TOP OF MY HEAD. It's been a year or so since I did a minimized bot...

Because you've copied code, you're over complicating your script... making it harder for you to understand.

Break it down like this :

Step 1: Set a hotkey to run your script

hotkeyset("{INSERT}","BotFunc")

Step 2: Create a loop so that your script will stay running when you start it.

While 1

Sleep(100)

WEnd

Step 3: Create a function that will do your work. What I laid out is very basic. It sends a keypress, sleeps for 1 second and then starts over again.

((You'll find out that games keep track of keypresses and there are some things needed to make this script undetectable... message me sometime if you're interested.))

Func BotFunc()

While 1;This loops untill the script is ended.

ControlSend("Gaia (New)","","","1"); This sends a "1" to gaia window.

Sleep(1000) ; This sleeps for 1 second

WEnd; This closes the loop

EndFunc; This closes the func

Share this post


Link to post
Share on other sites

ok, i had it working last night. it would use meds by itself, but when i log 2 accounts in. it wants to snap to a screen. so whenever i start the script and it presses a button, it always focuses on that screen so it isnt even minimized anymore.

my script reads this

While 1=1

ControlSend("Gaia", "", "Edit1", "1")

Sleep(1000)

Wend

this script works until i bring up a second client.

the full client names are. Gaia (New) - Septum and Gaia (New) - TIGGOBITTIES

ive tried changing it to this.

ControlSend("Gaia (New) - TIGGOBITTIES", "", "Edit1", "1") and

ControlSend("TIGGOBITTIES", "", "Edit1", "1") no luck

if anyone can help me figure this out, it would be a great help, thanks all :)

Share this post


Link to post
Share on other sites

nvm, its all sorted. thanks guys :)

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