SRL Archive - SRL Archives

completed hatchet head finding function


solemn wishes

2006-04-14 12:07:53

hey,

well my latest script involves woodcutting and it was kinda getting on my nerves that the user is restricted to having an axe in the first inventory slot for woodcutting so i added to it.



Function FindAxeHeadColor:Boolean;
begin
GameTab(4);
wait(100 + random(200));
Mmouse(587, 219, 0, 0)
wait(500 + random(500));
if(Isuptext('Wield'))then
begin
Head := GetColor(590, 220);
Head2 := GetColor(587, 219);
Head3 := GetColor(588, 218);
writeln('Axe head colors: ' +inttostr(Head)+ ' '+inttostr(Head2)+ ' ' +inttostr(Head3));
Result:= true;
end else
begin
gametab(5);
Mmouse(599, 296, 0, 0)
wait(500)
if(Isuptext('axe'))then
begin
getmousepos(x,y)
Head := GetColor(x, y);
Head2 := GetColor(x, y+1);
Head3 := GetColor(x-1,y-1);
writeln('Axe head colors: ' +inttostr(Head)+ ' '+inttostr(Head2)+ ' ' +inttostr(Head3));
Result:= true;
end;
if not result then
begin
writeln('Head not found')
Terminatescript;
end;
end;
end;

Renax

2006-04-14 13:30:38

just make a bitmap then you can have the axe anywere, and please learn standards your code is so ugly :)

XxKanexX

2006-04-14 21:27:19

Renax it's not that bad, and could you please stop targetting standards now. It's just getting a little annoying. ;)

Gj Solemn. :)

Renax

2006-04-14 22:13:43

Kane just look at it i can't stand ugly code its so replusive thats how i coded when i first started but then i found tab :)

and kane i always put a helpful suggestion along with my standards rant its not like i'm being mean about it.

if i was mean i might stumble across a "Ban if code isn't formatted button." but i won't do that… yet ;)

Pwnd

2006-04-15 13:56:55


function FindAxeHeadColor: boolean;
begin
GameTab(4);
Wait(100 + random(200));
MMouse(587, 219, 0, 0);
Wait(500 + random(500));
if(Isuptext('Wield'))then
begin
Head:= GetColor(590, 220);
Head2:= GetColor(587, 219);
Head3:= GetColor(588, 218);
WriteLn('Axe head colors: ' + inttostr(Head) + ' '
+ inttostr(Head2) + ' ' + inttostr(Head3));
Result:= true;
end else
begin
gametab(5);
MMouse(599, 296, 0, 0);
wait(500);
if(Isuptext('axe'))then
begin
getmousepos(x,y)
Head:= GetColor(x, y);
Head2:= GetColor(x, y+1);
Head3:= GetColor(x-1,y-1);
writeln('Axe head colors: ' + inttostr(Head) + ' '
+ inttostr(Head2) + ' ' + inttostr(Head3));
Result:= true;
end;
if(not(result))then
begin
writeln('Head not found')
Terminatescript;
end;
end;
end;

XxKanexX

2006-04-15 19:21:29

From: Renax
Kane just look at it i can't stand ugly code its so replusive thats how i coded when i first started but then i found tab :)

and kane i always put a helpful suggestion along with my standards rant its not like i'm being mean about it.

if i was mean i might stumble across a "Ban if code isn't formatted button." but i won't do that… yet ;)

Lol, i know you're only trying to help everyone. But it is his choice to code like that.

It isn't that ugly. It's still Legible :D

Renax

2006-04-15 21:33:46

everything in SRL has to be formatted that's why we (RsN) made the SRL standards so long ago, if it all fits this band of misfits seems somewhat proffessional.

and pwnd i believe that


if () then
begin
MurderSchoolChildren(x, y);
ShootSelfInHead(Headx, Heady);
end;

is how if, then, begin statements go. not like this.


if () then
begin
MurderSchoolChildren(x, y);
ShootSelfInHead(Headx, Heady);
end;

you have one of each, if your gonna do it, do it right.

phantombmx

2006-04-15 22:48:18

renex.. everyone has a different set of standards that they go by.. most people i have seen do it like you said should not be done.. the extra 2 spaces makes it easier for me to read.. actually anything that is decent works for me.. learn to lighten up a bit on standards.. i mean yeah they are important.. but dont go overboard on keepin it under control.. people learn eventually..

also, anything that goes into srl ends up gettin formatted properly by like kane someone like that..

XxKanexX

2006-04-15 23:12:51

From: phantombmx
renex.. everyone has a different set of standards that they go by.. most people i have seen do it like you said should not be done.. the extra 2 spaces makes it easier for me to read.. actually anything that is decent works for me.. learn to lighten up a bit on standards.. i mean yeah they are important.. but dont go overboard on keepin it under control.. people learn eventually..

also, anything that goes into srl ends up gettin formatted properly by like kane someone like that..

Interesting. Why wasn't i aware of this? :p

Renax

2006-04-16 11:23:56

my name is Renax not renex, and i really don't believe that i'm being that tough, mean, or scrict about standards i just don't see why people don't use them, neat formatted code is the sign of a respectful programmer.

Pwnd

2006-04-16 11:25:50

From: Renax
my name is Renax not renex, and i really don't believe that i'm being that tough, mean, or scrict about standards i just don't see why people don't use them, neat formatted code is the sign of a respectful programmer.

He's not a respectful programmer then; and he gives me a job from time to fime :D

solemn wishes

2006-04-16 14:31:54

From: Renax
my name is Renax not renex, and i really don't believe that i'm being that tough, mean, or scrict about standards i just don't see why people don't use them, neat formatted code is the sign of a respectful programmer.


so if i write out my own type of standards and post em it makes me respectfull programmer? o and anyone who uses them automaticly is?

…….

….im up to inproving the way i script but is it really that inportant? i dont see any standards in some of the new srl procedures.

Sdcit

2006-04-16 14:36:19

No more arguing about standards. We support them, thats all ok. If someone puts something into SRL withought them though. It is : 1. deleted. 2. Fixed. It will be trust me sollemm. Great work solem

Pyro

2006-04-17 01:55:33

*cowers under renaxs power* i used to use 1 space for standards :eek: but after finding standards a use 2 :eek: lol it sounds silly and it is. Makes no difference to me but more often then not people like it with two spaces

XxKanexX

2006-04-17 02:08:44

From: Pwnd
time to fime

From: Renax
scrict

;) From time to time you can be strict. ;o

Renax

2006-04-17 11:10:54

i'm just very into eye pleasing code. and solemn you can be respected without being very good at what you do. i meant it to mean something closer to a "self" - respectful programmer
kinda way.