Request: Help with AHK (explanation in msg)

07/22/2009 19:10 tamorazana#1
1) I am working on an autofogger. So far I have gotten it to fog twice and sit using {F2}. But I cant make it repeat and I don't know why. Any ideas on making the script run itself over and over until ^p:: (Pause) command is used? and also how do I set up the pause command.

2) I need an example of a melee attacking program. I can't seem to make my bot jump around and kill any monster in the general area. So I need an example to work off of.

Any help would be appreciated, and in the final products of my work I will be sure to include you in the thanks and props area.

Thank you so much!
07/23/2009 06:55 Alexios#2
Hello.

1) To make the program repeat it self(doing the same thing again and again) just write
Code:
loop
{
;;;;;Here write your code. It will repeat it again and again until you close the program,
;;;;;or use pause command. Be carefull if your script contains clicks(in loop) and not a hotkey for pause!!
}

;;;After all the code you can write the hotkey you want and what it will do.
^p::pause ;;;;With that line if you click Ctrl+P you will pause the script/program.
2)I haven't made any melee attacking program,but I think it is pretty easy to make one that will work(not one of the best programs... but it will attack the monsters :D)
I think that if you use PixelSearch (I think that's the name of the function(?)) you can easily find out where a monster is and its coordinates and then click on it.

I hope I helped you. If you need more details just post here today or tomorrow and I will do my best to write in details anything you need. :)
07/24/2009 16:54 angelstoy#3
hey, here is now i would do it. if not using pixels or memory and a simple times i would do this.
Code:
SetTitleMatchMode, 2
sitf := fkey("F2")
fogf := fkey("F9")
return ;end of program startup
;--------------------------------------------------------
findco2:												;this gets the Co2 process id number so i can call that with
	if !id1												;ahk_id %id1% instead of the wintitle [Co.
	{       											;this makes it assigned to that one Co2 instance.
		tooltip, Activte Conquer Window Now [ 3 ]
		sleep, 1000
		tooltip, Activte Conquer Window Now [ 2 ]
		sleep, 1000
		tooltip, Activte Conquer Window Now [ 1 ]
		sleep, 1000
		WinGet,id1, ID,[Conq
		WinActivate, ahk_id %id1%
		if !id1
		{
			ttm("Can not find Conquer window!")
			exit
		}
		tooltip
	}
return
;--------------------
tt:					;tooltip kill timer
	tooltip
return
;--------------------
^p::				;pause toggle
	pause
return
;--------------------------------
^!s::							;fog toggle
foggerButton:
	if !fogger
	{
		gosub, findco2
		fogger := 1
		settimer,fogger 		;start timer
		ttm("Fogger [ON]")
	}
	else
	{
		fogger := 0
		settimer,fogger,off
		ttm("Fogger [OFF]")
	}
return
;--------------------------------------------------------------------
fogger:																;fog timer
	loop, 3
	{
		controlclick,x%fogf% y745,ahk_id %id1%,,right,,NA 			;y745 is lower line in co2win for fkeys
		sleep,100
		controlclick,x512 y384,ahk_id %id1%,,right,,NA 				;center click to start skill
		sleep,900
	}
	controlclick,x%sitf% y745,ahk_id %id1%,,Right,,NA				;sit fkey.. 
	sleep,10000
return
;------------------------
ttm(msg)				;tooltip msg set for 3 second display time
{
	tooltip,%msg%,0,0
	settimer,tt,3000
}
return
;------------------------
fkey(fval)				;F-Key to x-mouse position conversion
{
	if fval = F1
	return, 111
	else if fval = F2
	return, 153 
	else if fval = F3
	return, 193 
	else if fval = F4
	return, 233 
	else if fval = F5
	return, 275 
	else if fval = F6
	return, 317 
	else if fval = F7
	return, 355 
	else if fval = F8
	return, 397 
	else if fval = F9
	return, 437 
	else if fval = F10
	return, 476 
}
return
This works well for me. i haven't had time to really debug it and i wish i knew memory address reading so i could use that. i could make a pixel based one, but at least a timed one will totally run in background.
07/24/2009 22:02 Alexios#4
Pretty good :) although I don't like to make so many functions... but I guess that's me!