Color not there then do something

09/26/2007 07:06 phatal808#1
I'm writing a game bot for 2moons. I'm almost done. It uses a HP pot when health is low, it uses a MP pot when MP is low, it summons pet when pet's hp is low, it will attack the target the pet is attacking, and it loots the drops on the ground. This is the last thing I want to do to complete this.

There are 3 squares on screen that you place your HP pots and MP pots in. I'm trying to figure a way that when it does not see the HP pot (because there is none) it does some other actions that basically teleport you home.

Code:
;No HP Pots = TP
$coord = PixelSearch (17, 988, 18, 989, 0xBD616D, 1);HP slot empty?
If @error then
	ControlSend("2Moons","","","{i}"); Open inventory
	sleep(1000)
	MouseClick ("right", 713, 510, 1, 0); Right click TP scroll
	Call("Terminate")
endif
The HP pot icon is about 10 pixels wide and 20 pixels high. The center of the icon is 18,989 (1280x1024 32bit).

I mean this seems pretty cut and dry to me. Color not there then do this.
09/26/2007 07:34 leggojake#2
that works...its how i made sorc bot, mainly just pixelsearch, if not @error's, etc.
09/26/2007 21:36 phatal808#3
Do you have code for that portion of your bot? I don't know if i'm using the wrong color or what, but if i turn it around and if it sees the pot then it works but having it tp when it doesnt see the pot doesnt work. idk.