Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

[Resolved]To make a script (for Maplestory) for rebuffing


  • Please log in to reply
28 replies to this topic
MapleBish
  • Members
  • 64 posts
  • Last active: Oct 29 2014 07:29 PM
  • Joined: 05 Jun 2012
I understand, for some reason, I had set my Maxthread to 10 lol.

From what I tested in Notepad, this is what the toggle does right now:

- When I first hit "h", the loop begins to run.
- If I hit "h" again, the loop continues to run without interruption.
- If I hit "h" a third time, the loop restarts immediately from the beginning.

Is this the way that this script is intended to run?

girlgamer
  • Moderators
  • 2997 posts
  • Last active: Today, 05:17 AM
  • Joined: 04 Jun 2010
first h: the loop starts to run
2nd h: the loop starts but exits because the flag is set
3d and any subsequent h: (with MaxThreadsPerHotkey set to 2 should be ignored http://www.autohotke...dsPerHotkey.htm

once the running thread hits the if test in the loop it should exit the loop with a return. if you need to exit the loop quickly you may need to provide more If (!htoggle) tests in the code. currently there is only one at the top of the loop so it will only trigger at the beginning of a new loop. If the loop is long you may want to put another if test somewhere in the middle.

MapleBish
  • Members
  • 64 posts
  • Last active: Oct 29 2014 07:29 PM
  • Joined: 05 Jun 2012
All right, so I'm trying to get the hang of ControlSend and the third parameter is WinTitle. I opened up Word and the title was
"Document2 - Microsoft Word"
However, no keystrokes appeared. Is there a way to get the correct WinTItle? It seems that I am inputting the wrong title.

MapleBish
  • Members
  • 64 posts
  • Last active: Oct 29 2014 07:29 PM
  • Joined: 05 Jun 2012

once the running thread hits the if test in the loop it should exit the loop with a return. if you need to exit the loop quickly you may need to provide more If (!htoggle) tests in the code. currently there is only one at the top of the loop so it will only trigger at the beginning of a new loop. If the loop is long you may want to put another if test somewhere in the middle.


Oh I see! I will try inserting at different stages and keep on testing. Thanks for all this help. I really appreciate it!

MapleBish
  • Members
  • 64 posts
  • Last active: Oct 29 2014 07:29 PM
  • Joined: 05 Jun 2012
Yay! I inserted in a spot inside the loop and now it works perfectly! Toggles on and off easily :D

Now once I can successfully use Controlsend to activate in-game skills, I only need to test the timings.

girlgamer
  • Moderators
  • 2997 posts
  • Last active: Today, 05:17 AM
  • Joined: 04 Jun 2010
Take a look at the SetTitleMatchMode command. http://www.autohotke...leMatchMode.htm with the option set to 2 you don't need a complete window title -- a partial match will work. additionally look at WinGetTitle, WinGetActiveStats and WinGet. ControlSend can be a tricky beast to work with especially if there is more than one "control" in the app you're targeting.

MapleBish
  • Members
  • 64 posts
  • Last active: Oct 29 2014 07:29 PM
  • Joined: 05 Jun 2012
All right thanks! Will get back to you ASAP when I get this working :D

MapleBish
  • Members
  • 64 posts
  • Last active: Oct 29 2014 07:29 PM
  • Joined: 05 Jun 2012
Hmmm.... How can I tell whether my title is just wrong, or my other coding is wrong?
The redded part: will it send the keystroke "a" to word?

$h:: ; start the loop
SetTitleMatchMode, 2
htoggle := !htoggle
if (!htoggle)
   Return

loop ; loop 6 times, approaching max number of times before anymore repetitions of the keystroke have no more effect

	{
	[color=#FF0000]controlSend,,a, "Document2 - Microsoft Word" ; hotkey for hs (holy symbol the skill)[/color]
	to recast skills and reset limit

Controlsend is really hard to use -__-.
I need to follow this template right?

ControlSend [, Control, Keys, WinTitle, WinText, ExcludeTitle, ExcludeText]

I think I have Keys and WinTitle down (and I can skip everything after that right?)...

Control "Can be either ClassNN (the classname and instance number of the control) or the name/text of the control"

I tried to research what ClassNN is and what to input in, but what everything says in the tutorial is confusing me. The tutorial says that this value can be determined through Windows Spy. I tried that and got the value _WwG1. Do I include the underscore preceding the W?

Thanks for the help!

MapleBish
  • Members
  • 64 posts
  • Last active: Oct 29 2014 07:29 PM
  • Joined: 05 Jun 2012
LOL Sorry for mass posting. BUT I GOT IT YESSSS ^__^. I inadvertently including quotation marks on my title which screwed it over :/



I just need to sub in Maplestory ClassNN and WinTitle now! Almost there xD!

MapleBish
  • Members
  • 64 posts
  • Last active: Oct 29 2014 07:29 PM
  • Joined: 05 Jun 2012
All righty. I've made significant progress. Here's the new code:

MapleBish
  • Members
  • 64 posts
  • Last active: Oct 29 2014 07:29 PM
  • Joined: 05 Jun 2012
Run into some trouble. I am trying to have the entire script in ControlSend so I am able to alt tab and do other things while the script runs. However, I cannot figure out a way to controlsend the arrow keys. To clarify, it is not to controlsend a single press of the arrow keys, but to hold them down for a period to move up and down a rope. I tried to controlsend {down down} and {down up} to word but that did not work either.

The code is above

MapleBish
  • Members
  • 64 posts
  • Last active: Oct 29 2014 07:29 PM
  • Joined: 05 Jun 2012
bumpity bump bump. I tried the general support and the overall perspective I received was that held down arrow keys could not be controlsended. I tried assigning a single ControlSend arrow key command to a hotkey such as "a", then having the script hold "a" for the duration and that kinda failed :3...

On a side note, would someone care to explain to me in simple laymen's terms exactly what keyboard hook does. I read the page on it, but did not really understand its general purpose.

girlgamer
  • Moderators
  • 2997 posts
  • Last active: Today, 05:17 AM
  • Joined: 04 Jun 2010
layman's terms.. hmmm lets see Suppose you are a fish swimming peacefully along just doing what fish do and you spot this nice juicy worm... well, as a human you KNOW that worms don't swim out in the water like that -- but you're a fish and that worm is looking pretty tasty right about now. so you grab the worm and all of a sudden bam! you're not swimming along like you did before there's something pulling you in a whole new direction. That's the hook and line thing in action.. now lets say you're a software program that's swimming along just doing keyboard stuff like normal and all of a sudden you're doing a whole different thing with keyboards. bingo. keyboard hook.
so from the help file you find this....

The keyboard hook monitors keystrokes for the purpose of activating hotstrings and any keyboard hotkeys not supported by RegisterHotkey (which is a function built into the operating system). It also supports a few other features such as the Input command.

mostly it just lets the keyboard fish swim along like usual but in some cases wham! it pulls it in a whole 'nother direction.

MapleBish
  • Members
  • 64 posts
  • Last active: Oct 29 2014 07:29 PM
  • Joined: 05 Jun 2012
That clears up some stuff. I was wondering if it could help me with being able to controlsend my entire script, but I guess not :p. The overall script is nearly complete actually. My original goal of getting the rebuffs on a timer is good, but I'm aiming to be able to completely controlsend the whole script. The only problem I have is controlsending the held down arrow keys for movement up and down a ladder..... This is actually the step I have spent 6+ hours trying to find a solution in vain......
Ugh. It seems so simple: it's just a simple "hold down the up key for 2000 ms" and then "hold down the down key for 2000 ms"...... WHY IS THIS SO HARD :'(