Technical support and scripting issues
Moderators: JRL, Dorian (MJT support)
-
VeroPC
- Newbie
- Posts: 5
- Joined: Sat Aug 13, 2011 4:47 pm
Post
by VeroPC » Sat Aug 13, 2011 4:57 pm
I use in-game the command waitcursorchange>1 but as the mouse scan a small interface the game window freeze.Did i done something wrong or the command freezes the window?
Code: Select all
SetFocus>Window_title
MoveWindow>Window_title,1,1
let>x=350
let>y=250
mousemove>58,118
wait>2
label>reset
let>y=250
label>Start
let>x=150
repeat>k
if>x<500
let>x=x+50
mousemove>x,y
wcc>0,5
if>wcc_result=TRUE
goto>pick
endif
else
if>y>300
goto>reset
endif
if>wcc_result=TRUE
goto>finish
endif
let>y=y+50
goto>Start
endif
Until>k
label>finish
message>Cursor Changed
Thx for you time reading my script :)
-
PepsiHog
- Automation Wizard
- Posts: 517
- Joined: Wed Apr 08, 2009 4:19 pm
- Location: Florida
Post
by PepsiHog » Sun Aug 14, 2011 5:53 am
Hello VeroPC,
It is difficult to understand your post. If I understand you correctly, you are saying you use this macro with a game. But the game freezes.
I believe to simplify, you posted an example macro. But there is no real information about what you are trying to accomplish. I can't test the macro without knowing the game that freezes on you. Since the type of game can effect the outcome of the macro.
Can you post the actual macro? And give better details. Like is the game on the web? What the game name is. And what you want the macro to do. There is more than one way to skin a cat. Maybe there might be other solutions to accomplish the same goal.
Windows 7
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!
-
VeroPC
- Newbie
- Posts: 5
- Joined: Sat Aug 13, 2011 4:47 pm
Post
by VeroPC » Sun Aug 14, 2011 7:45 am
The game website:
http://gw.igg.com
when a mob is dead i scan a little interface in the window to find the mob.When mob found cursor change into sword so i want to click it...i try to make a auto pick up program cuz the game has already afk system (let it to hit mobs without being on pc),so a program like that i want to create isn't illegal.
PS:I haven't create yet a label for pick up cuz i stuck in wcc :/
-
PepsiHog
- Automation Wizard
- Posts: 517
- Joined: Wed Apr 08, 2009 4:19 pm
- Location: Florida
Post
by PepsiHog » Sun Aug 14, 2011 2:31 pm
BTW - Any script you write to aid in a game is going to be LEGAL. Because the script is interacting with the game just as you do. BOTS on the other hand, are another story and are Illegal by most game rules.
Last edited by
PepsiHog on Sun Aug 14, 2011 4:06 pm, edited 1 time in total.
Windows 7
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!
-
PepsiHog
- Automation Wizard
- Posts: 517
- Joined: Wed Apr 08, 2009 4:19 pm
- Location: Florida
Post
by PepsiHog » Sun Aug 14, 2011 3:41 pm
Ok here is a macro that might work.
Code: Select all
// Depending on the keys used in the game, you might need to change
// the following keys.
// Looks for the F2 key to be pressed
OnEvent>Key_Down,VK113,0,DoMacro
// Looks for the F3 key to be pressed
OnEvent>Key_Down,VK114,0,DoExit
Label>Start
Goto>Start
srt>DoMacro
let>x=0
let>y=0
SetFocus>Window_Title
GetWindowPos>Window_Title,x,y
// ValX and ValY would be the values needed to add to x,y to get to the top, left corner of interface.
add>x,ValX
add>y,ValY
// let's say the interface is 300 pixels across.
// let's say the starting X is 460
// EndVal would be the greatest y value
Repeat>y
add>x,1
MouseMove>x,y
// Depending on how long it takes for the cursor to change
// you could adjust the following value. Maybe only .05 or something small
WaitCursorChanged>2
if>WCC_RESULT=True
LClick
endif
if>x>760
let>x=459
// one less because of the add at the start of loop
add>y,1
endif
Until>y=%EndVal%
GoTo>Start
END>DoMacro
srt>DoExit
exit
END>DoExit
You would need to do the calculations. This macro is a concept and won't work as is. But maybe this might work for you.
I had it on my mind so I wrote it. Not sure if this is all you need or not. You may even want to use WindowAction> to be sure the game window is full screen. Or even ResizeWindow>.
Last edited by
PepsiHog on Sun Aug 14, 2011 4:00 pm, edited 5 times in total.
Windows 7
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!
-
VeroPC
- Newbie
- Posts: 5
- Joined: Sat Aug 13, 2011 4:47 pm
Post
by VeroPC » Sun Aug 14, 2011 3:45 pm
I thought that something like that would be difficult (and as i see, it is) so i try to combine gaming and learning

-
VeroPC
- Newbie
- Posts: 5
- Joined: Sat Aug 13, 2011 4:47 pm
Post
by VeroPC » Tue Aug 16, 2011 6:43 am
I have tested your makro but when goes to read wcc_result the game window freezes.The same problem as mine makro :/
-
PepsiHog
- Automation Wizard
- Posts: 517
- Joined: Wed Apr 08, 2009 4:19 pm
- Location: Florida
Post
by PepsiHog » Thu Aug 18, 2011 10:35 pm
Just a thought. When you test the macro, how do you run it? Do you compile first? Or run directly from the editor?
In my experience sometimes a macro will succeed as an exe but not from the editor.
Windows 7
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!
-
VeroPC
- Newbie
- Posts: 5
- Joined: Sat Aug 13, 2011 4:47 pm
Post
by VeroPC » Sat Aug 20, 2011 8:14 pm
i tried both ways but on wcc always freeze the screen

i am totally disappointed

-
PepsiHog
- Automation Wizard
- Posts: 517
- Joined: Wed Apr 08, 2009 4:19 pm
- Location: Florida
Post
by PepsiHog » Sun Aug 21, 2011 3:49 am
Curious. What would happen if you click where a mob is NOT dead? If you get no result from such an action, then a work-around might be to have the macro click the entire interface.
You press a "hotkey" and the macro very quickly clicks the entire interface. The macro could do it within a matter of seconds.
If you think this might work and need help setting it up, I'll show you how.
Windows 7
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!