Jump to content


Photo

How would I change the information here?


  • Please log in to reply
8 replies to this topic

#1 UrbaN1nja

UrbaN1nja
  • Members
  • 5 posts

Posted 20 April 2012 - 01:03 AM

I have this script that I had found for a Video Game called Realm of The Mad God and rather than using the normal browser client I have an .swf file that I use on the browser.

I was wondering how it would be that I change it so I can get this to work for the .swf file (which is on my desktop)

I think that what is highlighted below is what should be changed to make it work correctly.


SetTitleMatchMode 2

RButton::
IfWinActive, Realm of The Mad God | Wild Shadow Forums
{
Click right
Return
}
IfWinActive, Realm of The Mad God
{
Send, {SHIFTDOWN}
Click
Sleep, 100
Send, {SHIFTUP}
Return
}
else
{
Click right
Return
}


I am not actually sure on how it would be changed and I had already read the tutorial and attempted to change it myself to no avail so I am requesting some help from those with much more knowledge than I have.

Also if there is more information that you need or have any questions at all I am more than willing to answer them to my best abilities.


Even if you are not sure how to do it or it happens to be something simple i could google any response at all would help me out :)

#2 a_h_k

a_h_k
  • Members
  • 681 posts

Posted 20 April 2012 - 05:10 AM

Have u checkd the window titles with AutoIt3 Window Spy?

#3 UrbaN1nja

UrbaN1nja
  • Members
  • 5 posts

Posted 20 April 2012 - 05:23 AM

This is what comes up

LiTHiuM.swf - Comodo Dragon
ahk_class Chrome_WidgetWin_0


So would I just use the first line...

IfWinActive, Realm of The Mad God | Wild Shadow Forums
{


in that area?

and use "lithium.swf" in this area...

IfWinActive, Realm of The Mad God
{


Or would that be the incorrect assumption?

#4 DethKlok

DethKlok
  • Members
  • 322 posts

Posted 20 April 2012 - 06:04 AM

try this out.
#IfWinActive LiTHiuM.swf - Comodo Dragon

RButton::

Click right

Send, {SHIFTDOWN}

Click

Sleep, 100

Send, {SHIFTUP}

Return

[color=RED]#IfWinActive[/color]
I forgot to add the red line in my first post.

#5 CodeKiller

CodeKiller
  • Members
  • 2066 posts

Posted 20 April 2012 - 09:05 AM

IfWinActive can't have multiple titles...
Use Group if you want to check more than one title.

#6 UrbaN1nja

UrbaN1nja
  • Members
  • 5 posts

Posted 20 April 2012 - 01:30 PM

So are you saying that this is how it should turn out?

SetTitleMatchMode 2

#IfWinActive LiTHiuM.swf - Comodo Dragon
RButton::
Click right
Send, {SHIFTDOWN}
Click
Sleep, 100
Send, {SHIFTUP}
Return
#IfWinActive
{
Send, {SHIFTDOWN}
Click
Sleep, 100
Send, {SHIFTUP}
Return
}
else
{
Click right
Return
}


Or should it just be

#IfWinActive LiTHiuM.swf - Comodo Dragon
RButton::
Click right
Send, {SHIFTDOWN}
Click
Sleep, 100
Send, {SHIFTUP}
Return
#IfWinActive


Or is it because that there are 2 of the IfWinActive commands it should not run correctly.
Because then I would not understand how the original script manages to run correctly when I use it.

I attempted the second idea but when i right clicked the screen it came up with the typical right click on a flash page menu and then half of the time the script would work correctly.
(typically in the game you would press the space bar to fire your ability and shift click to drink any potions, so the ahk script is intended to change the shift click and ability buttons to work instead with a right click.)

#7 DethKlok

DethKlok
  • Members
  • 322 posts

Posted 20 April 2012 - 01:48 PM

Okay you're kind of hard to understand, But I think I got you and fixed the mistake. Try this out, it should work.
[color=RED]#IfWinActive[/color] LiTHiuM.swf - Comodo Dragon

[color=GRAY]RButton[/color]::

[color=GREEN]SendInput[/color], {Shift Down}

[color=BLUE]Sleep[/color], 50

[color=GREEN]SendInput[/color], {LButton Down}{LButton Up}

[color=BLUE]Sleep[/color], 50

[color=GREEN]SendInput[/color], {Shift Up}

[color=GRAY]Return[/color]

[color=RED]#IfWinActive[/color]
If it doesn't work, make a step by step on what it should be like and tell us.

#8 UrbaN1nja

UrbaN1nja
  • Members
  • 5 posts

Posted 20 April 2012 - 02:03 PM

Okay you're kind of hard to understand, But I think I got you and fixed the mistake. Try this out, it should work.

[color=RED]#IfWinActive[/color] LiTHiuM.swf - Comodo Dragon
[color=GRAY]RButton[/color]::
[color=GREEN]SendInput[/color], {Shift Down}
[color=BLUE]Sleep[/color], 50
[color=GREEN]SendInput[/color], {LButton Down}{LButton Up}
[color=BLUE]Sleep[/color], 50
[color=GREEN]SendInput[/color], {Shift Up}
[color=GRAY]Return[/color]
[color=RED]#IfWinActive[/color]
If it doesn't work, make a step by step on what it should be like and tell us.



Sorry for being so confusing.
And yes this seems to work out correctly which I much appreciate for your time and effort.

The very first post is what the script originally looked like which what was intended for the regular browser client. Now what has been done makes it work for the .swf file that I am running on the browser.

Not exactly sure why my script is so much longer to do the same thing but then again I am still learning and missing some lessons that I plan on taking this later afternoon.

I still plan on learning ahk in the recommended order but what would be recommended to study more on to understand something like this? I am guessing more of the commands?

#9 UrbaN1nja

UrbaN1nja
  • Members
  • 5 posts

Posted 22 April 2012 - 05:51 AM

Also I was wondering if I happen to change the title to

>>>>>>>>>>( Window Title & Class )<<<<<<<<<<<
Adobe Flash Player 11
ahk_class ShockwaveFlash


Running the same exact thing off an .exe instead how would I go about making the most recent script work?

Tried changing the obvious but did not have an effect on it.


/e

sorry to bump again.
Just tried it again with the script that was recently made and found out it still works even though it has different title.