SRL Archive - OSR Help

Script Making Help


shaezy

2013-02-27 08:50:26

Hey guys/girls I am finally getting the hang of this scripting business and i have made a very very basic cow killing script which just consists of finding the cow and killing it. i'm planning to make it more complex but just starting with the basic.

But.. when its working it clicks other cows before if has killed the cow it is attacking.. also it tries to attack cows which someone else is fighting..

Any suggestions on how to fix this?

rj

2013-02-27 20:57:21

Use pixel shift to detect if your fighting, but IDK how to detect if other cows are fighting

Tombraider

2013-02-27 20:57:31

You need to determine the healthbar of your opponent.. i'm currently trying to get somekind of method for it myself as i have no slightest clue how to get my own personal healthbar nor the one you are fighting :P

Ian

2013-02-27 20:58:50

From: rjj95
Use pixel shift to detect if your fighting, but IDK how to detect if other cows are fighting


First find a cow, then look above the cow for a healthbar. If there isn't one, attack the cow.

rj

2013-02-27 22:06:47

From: BMWxi
First find a cow, then look above the cow for a healthbar. If there isn't one, attack the cow.

How do you do that lol?

Ian

2013-02-27 22:26:04

From: rjj95
How do you do that lol?


I was thinking something along the lines of making a TBox from a cow ATPA, then subtracting about 50 pixels from Y1 so the TBox extends to include the area where a a healthbar would be. Then search for the healthbar colors inside the TBox.

shaezy

2013-02-28 05:07:06

From: BMWxi
I was thinking something along the lines of making a TBox from a cow ATPA, then subtracting about 50 pixels from Y1 so the TBox extends to include the area where a a healthbar would be. Then search for the healthbar colors inside the TBox.


How would i go about doing that?

I'm looking at the pixelshift code, what's a tbox? i'm very sorry i'm an in-experienced scripter

also what is an ATPA?

Sjoe

2013-02-28 05:36:01

From: BMWxi
I was thinking something along the lines of making a TBox from a cow ATPA, then subtracting about 50 pixels from Y1 so the TBox extends to include the area where a a healthbar would be. Then search for the healthbar colors inside the TBox.


Too advanced for them lol.

Ian

2013-02-28 11:56:05

From: shaezy
How would i go about doing that?

I'm looking at the pixelshift code, what's a tbox? i'm very sorry i'm an in-experienced scripter

also what is an ATPA?

A TBox is a box made from two TPoints, and you can also make one from an ATPA.
An ATPA is an Array of TPAs, and TPAs are Arrays of TPoints.

I'd recommend starting with something easier though :)
From: Sjoekeloe
Too advanced for them lol.


I was originally responding to Rjj, I hoped he might be able to understand :)

shaezy

2013-02-28 20:59:54

Hey, I have an off topic question about the script i'm making.

i get this error "Identifier expected" but its on my "end." line at the end of the script???

what am i doing wrong?