SRL Archive - First Scripts

[SRL4] Spaz'z Powerminer


[S]paz

2007-10-14 12:51:51

i i tryed to update this a bit but im still no sure wats needed… pls help :D:D

ok i added the things suggested ..lol try this. thx for the feedback :D:D

Dumpin

2007-10-14 13:01:13

isn't it finished? maybe some more antiban, but I don't know what to add more to a power miner..

Sir R. M8gic1an

2007-10-14 13:56:41

Antibran:
anti:= Random(5); will return a number from 0-4, so you either have to adjust your case or do anti:= Random(5)+1;

WhatOre:
i'd start the if on coal and then work the way down, otherwise you'll be setting string[0] various times and you'll have to read through many if's if the user was lvl 38+
so i'd do it in this order:
coal
iron
tin
copper

oh n btw

If(level >= 38) Then
Begin
Players[CurrentPlayer].Strings[0] := 'Coal';
end;

//this will work the same way:
If(level >= 38) Then
Players[CurrentPlayer].Strings[0] := 'Coal';
when it's only one statement you don't need begin and end.
like in if not loggedin then exit;

checkinv:

If Not(LoggedIn) Then
begin
LoginPlayer;
Exit;
end;
You should never login a player inside a procedure, you should always do it on the mainloop, because otherwise the player will be stuck in a loop where it shouldn't be. for example your in a loop looking for the rocks. you log out and you login the next player. the next player is in the bank, but it's in the looking for rocks loop, which means it won't find any and therefore be put to false. and all the next players will be false too.


Case LowerCase(Players[CurrentPlayer].Strings[0]) Of
'copper': Dropall;
'tin': Dropall;
'iron': Dropall;
'coal': Dropall;
why case it if you're gonna drop all anyway?

FindGass:

if FindGas(x,y)then
begin
RunAwayDirection('N');
Wait(10000 + random(2000));
RunBack;
result:= true;
end;
you shouldn't run away from gas, you should just mine another rock:P

for your mining procedures i'd rather have only one procedure that checked which ore you're supposed to mine and then do it. instead of having four procedures that do the exact same thing, only difference is the color in findcolortolerance.

procedure Drop;
begin
dropall;
end;

you don't need this procedure, you can just use dropall; on it's own.

mainloop:
SetupSRL already gives u a mouse speed.
and again in the mainloop your repeat yourself.
here's what i'd do:

var
SearchColor: integer;

case Players[CurrentPlayer].Strings[0] of
'Copper': SearchColor := CopperRockColor;
'Tin': SearchColor := TinRockColor;
'Iron':SearchColor := IronRockcolor;
'Coal':SearchColor := CoalRockColor;

and then isntead of having 4 mining procedures you could just use
if(FindColorTolerance(x, y, SearchColor, 0, 0, 700, 500, 4))then

also your standards are a little off, and you should have a repeat in your mainloop outside of the if statments.
hope this helps you.

but it is a very good first script :)

~RMagician

mortenlt

2007-10-14 18:01:38

I will try this one out, and I think Rasta made some good suggestions.

Viper8 3

2007-10-14 19:59:51

Yeah, works pretty good. Morer anti-ban wouldn't hurt. GOod start

[S]paz

2007-10-15 13:07:49

chees for the responses guys.. ill add ur suggestions rasta
@mortenlt tell me how it goes
@viper8 3 ill ad some and we will see how it goes :D:D

Sir R. M8gic1an

2007-10-15 13:38:06

From: spaztaz666
chees for the responses guys.. ill add ur suggestions rasta
@mortenlt tell me how it goes
@viper8 3 ill ad some and we will see how it goes :D:D


be sure to send a pm my way when you do, and think about adding banking to it, for a later version ;)

lalaland

2007-10-15 20:40:48

When I tried to use this it said
"[Runtime Error] : Out Of Range in line 83 in script C:\Program Files\SCAR 3.12\Scripts\[srl4]powerminer.scar"
Thanks in advance!

Sir R. M8gic1an

2007-10-16 01:45:43

From: lalaland
When I tried to use this it said
"[Runtime Error] : Out Of Range in line 83 in script C:\Program Files\SCAR 3.12\Scripts\[srl4]powerminer.scar"
Thanks in advance!


leecher, that is your own fault.

RMagician

king_killer

2007-10-18 11:54:32

Yeah, works pretty good. Good start

Sir R. M8gic1an

2007-10-18 12:48:21

there's a new version people,

http://www.srl-forums.com/forum/powerminer-t21009.html

giggs526

2007-10-24 05:06:43

worked for me

geforce

2007-10-29 16:14:54

worked for me too:D

boommaster

2007-10-29 16:23:12

i think the script is ok:)

geforce

2007-10-30 04:25:21

good script

kepalinislt

2009-08-15 22:04:35

Line 107: [Error] (21111:1): Unknown identifier 'NickNameBMP' in script C:\Program Files\SCAR 3.21\Scripts\[srl4]powerminer.scar


HELP PLZ

Dynamite

2009-08-15 23:05:25

LOL the biggest Gravedig I have EVER seen.
Look at the date before you post:
10-30-2007, 09:25 AM

T~M