Originally Posted by
horst
Cause I dont want your first born to be named Sklug and the EU-Servers are down and im bored to death i looked into AutoIt (i just watched some Videos right now).
This Script should work. It has no fancy stuff like a Pause or End Button and i think you have to play in Window-Mode so AutoIt can detect it.
Code:
$r = Random(2000, 3500) ;Random Time between Key strokes, You may vary the min and max value to optimize for your ServerLag
WinActivate("World of Warcraft") ; Select World of Warcraft Window
While 1
Send("{1}") ; 1) Key you've put your Smuggling Run! - Spell - World of Warcraft on.
Sleep($r)
Send("{2}") ; 2) Key with TargetMacro
Sleep($r)
Send("{F7}") ; 3)The InteractionKey
Sleep($r)
Send("{3}") : ; 4)The GossipMacro
Sleep($r)
Send("{4}") : ; 5) The Buy Macro
Sleep($r)
Send("{5}") ; 6) The Open Crate Macro
Sleep(601000+$r+$r) ; 7)Waiting for Cooldown of Smugglers Run!
Wend
If someone knows his way around AutoIt he can optimze it if he wishes.
This is an interesting start... unfortunately, you are not truly randomizing the delay with the $r variable. You essentially randomized one time, but every single time you call to that $r it is now a set number that no longer changes. So let's say the first time the delay 2800 ms (2.8 seconds)... every single delay from then on is going to be 2.8 seconds. What you need is a method(aka function) that you can call to that re-randomizes every single time you call to the method. This helps you appear maybe, more human as it legitimately randomizes the inputs.
A simple rough code to do that would be creating a Randomization method. I should note because this language is kind of like a more refined Basic, there are much simpler ways to do this in more modern languages, but this one integrates into the Windows API real well and is just so easy to use for simple scripts. There are much less clumsy looking ways to integrate a random function into AHK than what I will write as well, but for doing what you are essentially doing this is probably the least taxing. There's some other ways we can loops some ranges to similar efficacy, but this works.
Code:
Rand( a=0.0, b=1 )
{
IfEqual,a,,Random,,% r := b = 1 ? Rand(0,0xFFFFFFFF) : b
Else Random,r,a,b
Return r
}
SleepRandom()
{
sleepRand := Rand(2650,3050)
sleep, %sleepRand%
}
Thus, in the future, when you want to sleep a random interval, all you need to write, using your code above is:
Code:
Send("{1}") ; 1) Key you've put your Smuggling Run! - Spell - World of Warcraft on.
SleepRandom()
Send("{2}") ; 2) Key with TargetMacro
SleepRandom()
Send("{F7}") ; 3)The InteractionKey
SleepRandom()
Send("{3}") : ; 4)The GossipMacro
SleepRandom()
and so on...
With that being said, I highly recommend using ControlSend instead of Send, but this requires a little extra setup as you need to identify the actual World of Warcraft unique window handle it has. The advantage is it would allow you to send the commands in the background, even if the window was not in the foreground. To do this you gotta use the "WinGet" command to determine the handle.
Honestly, you can look it up, but I'll write it once I actually get there and can check out this particular cool thing, I've just been in que for 8 hrs today and haven't been able to login at all, plus I only got 1 hr of playtime yesterday before servers crashed again and again and again...
Shouldn't take me long. I am more concerned about the 10 minute delay timer. Is it always exactly 10 minutes right on the dot from the moment of activating it, or does the 10 minute timer start at the end of when you actually finish all of those steps. This will be important for how I time the algorithm. Remember, this is going to be no different to the WOW window than you having keyboard plugged into windows and you typing away. All this does is literally simulate a real keyboard typing in windows and they cannot tell a difference. This means it is very safe, but it also means I am unable to do a memory hook into WOW and unable to make a more robust program where I could use logic where I could get a program to function within 1 second of the item becoming available again. Here, it'll just be a rough 10 minute, with maybe 30 second + delay for error comfort. That's a 3 min loss of efficiency in per hour minimum, and overnight, that could be a loss nearly 30 minutes worth of efficiency, the difference between an extra 300-400+ resources. Thus, I need to make sure it is tuned efficiently.
Again, the coding is easy, the tuning I just want to refine a little. Hopefully I'll get to it tonight.