Help with my macro :/ Isn't working

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Marcdk
Junior Coder
Posts: 36
Joined: Sat Sep 22, 2007 10:16 pm

Help with my macro :/ Isn't working

Post by Marcdk » Sun Mar 09, 2008 11:49 am

Hey everybody :)

I tried to make a macro which does the following: u press a button, F4, or something, then the bot sends some text which you can edit in the bot... here is my code:
Let>Comma=,
Dialog>Dialog1
Caption=Marcdks F-Tool
Width=450
Height=240
Top=193
Left=172
Close=0
Rezise=0
Label=Choose your sentences and then start the bot,56,20,true
Button=Start Bot,344,16,75,25,1
Label=Stop bot => Shift + Escape,304,40,true
Edit=Text1,24,64,185,Gl%Comma% Hf
Label=F5,8,72,true
Label=F6,216,64,true
Label=F7,8,112,true
Label=F8,216,112,true
Edit=Text2,232,64,185,From?
Label=F9,8,152,true
Edit=Text3,24,104,185,One Shot. One Kill%Comma% - No Luck%Comma% Just Skill!
Edit=Text4,232,104,185,GG NO RE!
Edit=Text5,24,144,185,Im Off%Comma% Cya Later Guys :)
Memo=Credit,296,152,125,40,This bot was made by: Marcdk
EndDialog>Dialog1



Label>MainLoop
Show>Dialog1,result
If>result=1,StartBot
Goto>MainLoop

Srt>StartBot
WindowAction>Open,Warcraft III
Goto>Start
End>StartBot

Label>Start
Onevent>Waitkeydown>VK116
press shift
press alt
wait>0.1
press enter
Send>%dialog1.Text1%
press enter
release ctrl
release alt
goto>2
label>end

Label>2
Onevent>Waitkeydown>VK117
press shift
press alt
wait>0.1
press enter
Send>%dialog1.Text2%
press enter
release ctrl
release alt
goto>3
label>end

Label>3
Onevent>Waitkeydown>VK118
press shift
press alt
wait>0.1
press enter
Send>%dialog1.Text3%
press enter
release ctrl
release alt
goto>4
label>end

Label>4
Onevent>Waitkeydown>VK119
press shift
press alt
wait>0.1
press enter
Send>%dialog1.Text4%
press enter
release ctrl
release alt
goto>5
Label>end

Label>5
Onevent>Waitkeydown>VK120
press shift
press alt
wait>0.1
press enter
Send>%dialog1.Text5%
press enter
release ctrl
release alt
goto>Start
Label>end
When i load it, it doesn't wait for the keydowns, why? I cant fix this :/ any help?

thx :)

bsharp
Newbie
Posts: 16
Joined: Tue Nov 29, 2005 6:39 am
Location: New York

Post by bsharp » Sun Mar 09, 2008 2:37 pm

I would think you need to add an onevent to the first loop "Start Bot". That way it will loop until key press?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sun Mar 09, 2008 2:49 pm

I have notlooked at the whole script, but these few things stand out:

1. WindowAction> takes the values 0-5, there is no Open
2. You have multiple commands on the same line, unless you are using ">" as "greater than"
3. OnEvent> takes KEY_DOWN, not WaitKeyDown
4. OnEvent> takes 4 parameters

That should get you started.
Check out the examples for those commands in the Help section.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

bsharp
Newbie
Posts: 16
Joined: Tue Nov 29, 2005 6:39 am
Location: New York

Post by bsharp » Sun Mar 09, 2008 3:15 pm

I played around a little bit and got this working with note pad. and numberpad keys. Hope it helps

Code: Select all

Label>Start

Let>Comma=,
Dialog>Dialog1
Caption=Marcdks F-Tool
Width=450
Height=240
Top=193
Left=172
Close=0
Rezise=0
Label=Choose your sentences and then start the bot,56,20,true
Button=Start Bot,344,16,75,25,1
Label=Stop bot => Shift + Escape,304,40,true
Edit=Text1,24,64,185,Gl%Comma% Hf
Label=F5,8,72,true
Label=F6,216,64,true
Label=F7,8,112,true
Label=F8,216,112,true
Edit=Text2,232,64,185,From?
Label=F9,8,152,true
Edit=Text3,24,104,185,One Shot. One Kill%Comma% - No Luck%Comma% Just Skill!
Edit=Text4,232,104,185,GG NO RE!
Edit=Text5,24,144,185,Im Off%Comma% Cya Later Guys Smile
Memo=Credit,296,152,125,40,This bot was made by: Marcdk
EndDialog>Dialog1



Label>MainLoop
Show>Dialog1,result
If>result=1,StartBot
Goto>MainLoop

Srt>StartBot
Label>startloop
WindowAction>Open,Untitled - Notepad
OnEvent>KEY_DOWN,VK96,0,1
OnEvent>KEY_DOWN,VK97,0,2
OnEvent>KEY_DOWN,VK98,0,3
OnEvent>KEY_DOWN,VK99,0,4
OnEvent>KEY_DOWN,VK100,0,5
Goto>startloop
End>StartBot

Srt>1
wait>0.1
Send>%dialog1.Text1%
press enter
End>1


Srt>2
wait>0.1
Send>%dialog1.Text2%
press enter
End>2


Srt>3
wait>0.1
Send>%dialog1.Text3%
press enter
End>3


Srt>4
wait>0.1
Send>%dialog1.Text4%
press enter
End>4


Srt>5
wait>0.1
Send>%dialog1.Text5%
press enter
End>5


Label>Finish

Marcdk
Junior Coder
Posts: 36
Joined: Sat Sep 22, 2007 10:16 pm

Post by Marcdk » Sun Mar 09, 2008 6:30 pm

THX! this is actually working :D Now i can edit it to myself, this is just great :) Thank you very much man :)

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts