I can LClick only once

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Shimizoki
Newbie
Posts: 9
Joined: Tue Feb 19, 2008 10:42 pm

I can LClick only once

Post by Shimizoki » Tue Feb 19, 2008 11:00 pm

I'm uber new to this, I just started today. I was making a auto login for a game called Domo at domo.aeriagames.com (product placement). Either way i can LClick to get past the first step, but once the game loads you can see the animation where it tries to LClick but nothing happens. What do you think is my issue? I have tried adding waits in front of the LClicks thinking it may be a timing issue as i have read in the other threads but that didn't seem to be it. I'm using 10.020e.

Code: Select all

Run Program>C:\AeriaGames\DOMO\_domopatch.exe
WaitScreenImage>C:\Program Files\Macro Scheduler\Images\Domopatch - Start.bmp,20
GetScreenRes>sX,sY
ScreenCapture>0,0,sX,sY,C:\Program Files\Macro Scheduler\Images\Domo Start Screen.bmp
FindImagePos>C:\Program Files\Macro Scheduler\Images\Domopatch - Start.bmp,C:\Program Files\Macro Scheduler\Images\Domo Start Screen.bmp,20,1,XPos,YPos,imgs
if>imgs>0
	MouseMove>XPos_0,YPos_0
	LClick
endif
WaitScreenImage>C:\Program Files\Macro Scheduler\Images\Domo LogIn Msg.bmp,20
Wait>1
Send>UserName
Wait>1
Press Tab
Wait>1
Send>Password
wait>1
Press Enter
wait>7
ScreenCapture>0,0,sX,sY,C:\Program Files\Macro Scheduler\Images\Domo Server Screen.bmp
FindImagePos>C:\Program Files\Macro Scheduler\Images\Domo ONYX Server.bmp,C:\Program Files\Macro Scheduler\Images\Domo Server Screen.bmp,20,1,XPos,YPos,imgs
if>imgs>0
	MouseMove>XPos_0,YPos_0
	LClick
endif
WaitScreenImage>C:\Program Files\Macro Scheduler\Images\Domo Choose Char.bmp,20
MouseMove>450,500
LClick
EDIT:::
I seemed to have been able to fix the problem with
LDown
Wait>1
LUp

Why would that make any difference, it said in the help file that it does the same thing as LClick, so I'm lost now. but LDblClick doesn't seem to work either. I'm starting to think that since its online it takes a bit to recognizes the button presses and the computer works faster than the internet can transmit but like i said i just don't know. help would still be appreciated. Thanks

Shimizoki
Newbie
Posts: 9
Joined: Tue Feb 19, 2008 10:42 pm

Sorry to Double Post

Post by Shimizoki » Wed Feb 20, 2008 1:39 am

Ok so this seems to be a thread all to me. In that case i have a problem now using ScreenCapture for some reason it's not saving the image therefore when i use FindImagePos it automatically fails. What could be my problem?

Code: Select all

WindowAction>restore,DOMO - Dream Of Mirror Online(Dec 28 2007)
Wait>1
WaitScreenImage>C:\Program Files\Macro Scheduler\Images\Courageous Chorus.bmp,20
ScreenCapture>0,0,sX,sY,C:\Program Files\Macro Scheduler\Images\Domo Game Screen.bmp
FindImagePos>C:\Program Files\Macro Scheduler\Images\Courageous Chorus.bmp,C:\Program Files\Macro Scheduler\Images\Domo Game Screen.bmp,20,1,XPos,YPos,imgs
if>imgs>0
	MouseMove>XPos_0,YPos_0
	LDown
	Wait>.5
	LUp
endif
Wait>1
WaitScreenImage>C:\Program Files\Macro Scheduler\Images\Courageous Chorus.bmp,20
ScreenCapture>0,0,sX,sY,C:\Program Files\Macro Scheduler\Images\Domo Game Screen.bmp
FindImagePos>C:\Program Files\Macro Scheduler\Images\Courageous Chorus.bmp,C:\Program Files\Macro Scheduler\Images\Mystic Mantra.bmp,20,1,XPos,YPos,imgs
if>imgs>0
	MouseMove>XPos_0,YPos_0
	LDown
	Wait>.5
	LUp
endif
Wait>1
WaitScreenImage>C:\Program Files\Macro Scheduler\Images\Dilligent Ditty.bmp,20
ScreenCapture>0,0,sX,sY,C:\Program Files\Macro Scheduler\Images\Domo Game Screen.bmp
FindImagePos>C:\Program Files\Macro Scheduler\Images\Courageous Chorus.bmp,C:\Program Files\Macro Scheduler\Images\Dilligent Ditty.bmp,20,1,XPos,YPos,imgs
if>imgs>0
	MouseMove>XPos_0,YPos_0
	LDown
	Wait>.5
	LUp
endif
Wait>9

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Wed Feb 20, 2008 2:15 am

ScreenCapture>0,0,sX,sY,

Where are you defining sX and sY ?

Shimizoki
Newbie
Posts: 9
Joined: Tue Feb 19, 2008 10:42 pm

Post by Shimizoki » Wed Feb 20, 2008 11:01 pm

wow.... ok so that makes sense, i did it in the first example and forgot to do it in the second... thanks. Also do you know why in windows the LClick works but for me in non-windows programs (games) i usually have to do a LDown wait Lup?

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Thu Feb 21, 2008 3:25 am

Shimizoki wrote:Also do you know why in windows the LClick works but for me in non-windows programs (games) i usually have to do a LDown wait Lup?
Hi Shimizoki,

I'm not sure why you would want a Wait statement between the LDown and LUp. That is simulating someone clicking down and holding it down and then later releasing. Is that .5 wait in there because you found it works better that way through trial end error?

The help file on LClick says...
  • LClick

    Simulates a left button mouse click at the current point on the screen.

    The following commands will produce the same result :

    LDown
    LUp
...so I'd expect either/or to work exactly the same in any given situation. However, you seem to be finding otherwise.

How does it work if you use LDown then LUp with no Wait in between?
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Feb 21, 2008 8:48 am

Each and every one of the many millions of applications out there in the wild work in many different weird and wonderful ways. We cannot always answer why one app works one way but another needs a different approach. Sometimes a bit of trial and error is necessary.

If you've found you need to break down the LClick to put a delay between the LDown and LUp for this particular application then, great, you have a solution, so use it. For some reason this particular app needs a bit of thinking time between each part of the LClick. LCLick is probably working too fast for it. LClick most likely does a Down then an Up faster than most humans could.

If I had to guess why it needs more time than a regular Windows program I would say it is because it is a game and is working harder, doing more processing behind the scenes. But like I said, we can only guess at the WHYs. The important thing is finding WHAT works and sticking with it.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Shimizoki
Newbie
Posts: 9
Joined: Tue Feb 19, 2008 10:42 pm

Thanks

Post by Shimizoki » Sat Feb 23, 2008 3:55 pm

Thank you everyone, yes i found that it is best this way through trial and error. LDown, LUp wouldn't work at all but i thank you for your speculations. I don't know if i should start a new thread or not but another question i have is can i set a variable based off of a memory location? for example lest say that in a game the HP is always stored in memory location 01EAD4B2, If i want to take the value of that memory and use it in a variable (if the value of memory location X = 0 (which does create it)
...
...
...
Add>X, 1 (which gives me an error) Or use
Let>X = X + 1 (which sets X = "X+1")
so what am i missing there?

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Sat Feb 23, 2008 5:45 pm

If Add>X, 1 is giving you an error then there is no value previously assigned to X. You can test this in a fresh macro:

Let>X=0
Add>X, 1

works, but

Add>X, 1

without the Let>X=0 will error

What is the code in your macro that you think should be assigning a value to X?

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sat Feb 23, 2008 5:47 pm

And also remove the spaces:

Let>X=1
Add>X,1
Let>X=X+1

(Unless you have IGNORESPACES defined)
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Shimizoki
Newbie
Posts: 9
Joined: Tue Feb 19, 2008 10:42 pm

You people are amazing

Post by Shimizoki » Sat Feb 23, 2008 7:33 pm

Thanks, i read other posts and found out about the IGNORESPACES=1 thing, as for
If Add>X, 1 is giving you an error then there is no value previously assigned to X. You can test this in a fresh macro:
I had X previously defined already by doing exactly as you said. So i thank you both for your help, but between a combination of what you two told me i got it working. I also read that it is VB compatible? If so, is there a special tag that i need to use to tell the Macro's compiler that it will be switching to VB? i know a little of it and a decent amount of C++ (can you use that?). Honestly i have been looking for a macro program for a while and this is the best one that i have ever used. so thanks again.

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sat Feb 23, 2008 7:59 pm

You can include VBScript in Macro Scheduler. Insert VBScript code between VBSTART and VBEND blocks. Run subroutines with VBRun and evaluate VBScript with VBEval.

Please see the sample scripts provided, the help file on VBSTART, VBEND, VBRun and VBEVal, the examples in the help file, and the many, many examples and posts in this forum (search for VBSTART).
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Shimizoki
Newbie
Posts: 9
Joined: Tue Feb 19, 2008 10:42 pm

Thanks

Post by Shimizoki » Sat Feb 23, 2008 9:54 pm

Will do thank you. about my question earlier about the memory locations, is it possible to do something like that? or to find a pull a variable from a program (obviously you wouldn't know exactly how to do it in the program i need) but if it is possible if you can help me out i would appreciate it , thanks again for your help.

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sat Feb 23, 2008 11:04 pm

No, you can't read memory with Macro Scheduler. You'll need a lower level programming language to do things like that.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Shimizoki
Newbie
Posts: 9
Joined: Tue Feb 19, 2008 10:42 pm

hmm i see

Post by Shimizoki » Mon Feb 25, 2008 10:11 pm

Ok, thanks

then instead how i could take a variable from a game? such as HP? and make a macro that can read it?

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Feb 25, 2008 10:23 pm

Not really sure how to answer that as I'm not sure how a game can have a variable that is available to another app. What do you mean by variable? What format is the data in - is it in a file or on the screen? An app can't read a variable within another app. But perhaops you don't mean variable.

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