YoHoJo
2012-05-25 03:46:53
Don't know a thing about them.
Can someone link me to scripts which utilize them.
Want to see some examples of them.
Thanks.
Can someone link me to scripts which utilize them.
Want to see some examples of them.
Thanks.
2012-05-25 03:46:53
2012-05-25 03:52:43
2012-05-25 03:53:21
Type //Define a new 'Type'
TEnemy = record //Name of your new 'Type', in this case "TEnemy"
WSize,HSize: Integer;
Cols,Tols: TIntegerArray;
HMods,SMods: Array of Extended;
Strings: TStringArray;
TExp,THPExp: Integer;
end; //Everything within this block is what makes up your new 'Type'
Var
TEnemies: Array [0..4] of TEnemy; //Or just TEnemies: Array of TEnemy;
with TEnemies[Minotaur] do
begin
Cols := [8686218];
Tols := [6];
WSize := 20;
HSize := 30;
HMods := [0.47];
SMods := [0.14];
Strings := ['ck M','inot', 'taur'];
TExp := 40;
THPExp := 13;
end;
2012-05-25 04:05:37
2012-05-25 05:56:07
program New;
{$DEFINE SMART}
{$i SRL/srl.simba}
Type
TEnemy = record
WSize,HSize: Integer;
Cols,Tols: TIntegerArray;
HMods,SMods: Array of Extended;
Strings: TStringArray;
end;
Var
GiantRat: TEnemy;
Procedure SetOurEnemy;
begin
With GiantRat do
begin
Cols := [5066577];
Tols := [3];
WSize := 30;
HSize := 30;
HMods := [1.86];
SMods := [0.17];
Strings := ['ck G','iant', 't ra'];
end;
end;
{*******************************************************************************
Procedure FindFreeTargets(Target: TEnemy; MinCount, SType: Integer; Var TPs: TPointArray);
By: Flight
Description: Finds all available (not in combat) NPCs on the mainscreen
through the TEnemy type. Returns a (wrapped) TPointArray of every TEnemy found
sorted from the center screen.
-MinCount: Minimal amount color count to be found in TEnemy's bounds
to be considered a target
-SType: TPA Split-type (1 for SplitTPA, 2 for TPAtoATPA)
*******************************************************************************}
Procedure FindFreeTargets(Target: TEnemy; MinCount, SType: Integer; Var TPs: TPointArray);
var
B,HPB: TBox;
TP,MHPB,MNPCB: TPoint;
TPA,GPA,RPA,
GPB,RPB,RTPA,PArr: TPointArray;
i,CTS,R,a: Integer;
ATPA: T2DPointArray;
begin
CTS := GetColorToleranceSpeed;
TPAFromBoxWrap(IntToBox(245, 135, 280, 185), PArr);
for a := 0 to High(Target.Cols) do //Target's (TEnemy) Cols (array)
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Target.HMods[a], Target.SMods[a]); //Target's HMods[] & SMods[]
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Target.Cols[a], MSX1, MSY1, MSX2, MSY2, Target.Tols[a]); //Target's Col[] & Tols[]
ClearTPAFromTPAWrap(TPA, PArr, TPA);
ColorToleranceSpeed(CTS);
if (Length(TPA) > 0) then break;
end;
if (Length(TPA) < 1) then
Exit;
if InRange(SType, 1, 2) then
begin
if (SType = 1) then
SplitTPAExWrap(TPA, Target.WSize, Target.HSize, ATPA) //Target's WSize & HSize
else if (SType = 2) then
TPAtoATPAExWrap(TPA, Target.WSize, Target.HSize, ATPA); //Target's WSize & HSize
end else
begin
Writeln('[Pulse] Error: Invalid SType');
Exit;
end;
SortATPAFromFirstpoint(ATPA, Point(MSCX, MSCY));
for i := 0 to High(ATPA) do
begin
if (Length(ATPA[i]) >= MinCount) then
B := GetTPABounds(ATPA[i])
else
Continue;
with B do
begin
TP := Point(((B.X1+B.X2)/2), B.Y1);
if (TP.X < MSX1) then
TP.X := MSX1;
if (TP.Y < MSY1) then
TP.Y := MSY1;
HPB:= IntToBox(TP.X-30, TP.Y-40, TP.X+30, TP.Y);
if (HPB.X1 < MSX1) then
HPB.X1 := MSX1;
if (HPB.X2 > MSX2) then
HPB.X2 := MSX2;
if (HPB.Y1 < MSY1) then
HPB.Y1 := MSY1;
if (HPB.Y2 > MSY2) then
HPB.Y1 := MSY2;
MHPB := MiddleBox(HPB);
MNPCB := MiddleBox(B);
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.71, 0.00);
FindColorsSpiralTolerance(MNPCB.X, MNPCB.Y, GPA, 43824, B.X1, B.Y1, B.X2, B.Y2, 6);
SetColorSpeed2Modifiers(0.08, 0.00);
FindColorsSpiralTolerance(MNPCB.X, MNPCB.Y, RPA, 262306, B.X1, B.Y1, B.X2, B.Y2, 5);
SetColorSpeed2Modifiers(0.71, 0.00);
FindColorsSpiralTolerance(MHPB.X, MHPB.Y, GPB, 43824, HPB.X1, HPB.Y1, HPB.X2, HPB.Y2, 6);
SetColorSpeed2Modifiers(0.08, 0.00);
FindColorsSpiralTolerance(MHPB.X, MHPB.Y, RPB, 262306, HPB.X1, HPB.Y1, HPB.X2, HPB.Y2, 5);
ColorToleranceSpeed(CTS);
if ((Length(GPA) = 0) and (Length(RPA) = 0)
and (Length(GPB) = 0) and (Length(RPB) = 0)) then
begin
if (MNPCB <> Point(0, 0)) then
begin
SetArrayLength(RTPA, (Length(RTPA)+1));
RTPA[R] := MNPCB;
Inc(R);
end;
end;
end;
end;
SortTPAFrom(RTPA, Point(MSCX, MSCY));
TPs := RTPA;
end;
Procedure AttackRats;
Var
i: Integer;
RatPoints: TPointArray;
begin
FindFreeTargets(GiantRat, 50, 2, RatPoints); //Because 'FindFreeTargets' is a wrapper, "RatPoints" is
//input as an emypty variable and given back populated with a TPA
for i:=0 to High(RatPoints) do
begin
//Attacking, ect...
end;
end;
begin
Smart_Server := 86;
Smart_Members := True;
Smart_Signed := True;
setupSRL();
SetOurEnemy; //This MUST be declared before the remaining script; it declares the 'GiantRat' TEnemy
AttackRats;
end.
2012-05-25 06:32:29
2012-05-25 06:35:55
2012-05-25 06:49:01
Program potato;
type
TSize = record
width, height: Extended;
end;
TPotato = record
x, y: Integer;
size: TSize;
end;
TPotatoArray = Array of TPotato;
function Potato(x, y:Integer; width, height:Extended):TPotato;
begin
Result.x := x;
Result.y := y;
Result.size.width := width;
Result.size.height := height;
end;
var
TPA:TPotatoArray;
begin
SetLength(TPA,2);
TPA[0].x := 3;
TPA[0].y := 4;
TPA[0].size.width := 50;
TPA[0].size.height := 20;
TPA[1] := Potato(10,15,40,40);
writeln(TPA);
end.
2012-05-25 06:51:43
2012-05-25 07:09:40
2012-05-25 07:17:24
2012-05-25 08:52:08
2012-05-25 09:06:46
2012-05-25 09:54:19
Program potato;Standard start of every program!TSize = record
width, height: Extended;
end;
TPotato = record
x, y: Integer;
size: TSize;
end;
TPotatoArray = Array of TPotato;var size:TSize;
begin
size.height := 10;
size.width := 5.3;
writeln('the size is ' + ToStr(size.height) + ' pixels width and ' + ToStr(size.width) + ' pixels height');
end.var
potato:TPotato;
begin
potato.x := 3;
potato.y := 5;
potato.size.height := 10;
potato.size.width := 20;
writeln('where is my potato?');
writeln('[x = ' + ToStr(potato.x) + ' , y = ' + ToStr(potato.y) + ']');
writeln('how big is my potato?');
writeln('[height = ' + ToStr(potato.size.height) + ' , width = ' + ToStr(potato.size.width) + ']');
end.function Potato(x, y:Integer; width, height:Extended):TPotato;
begin
Result.x := x;
Result.y := y;
Result.size.width := width;
Result.size.height := height;
end;var
TPA:TPotatoArray;
begin
SetLength(TPA,2);
TPA[0].x := 3;
TPA[0].y := 4;
TPA[0].size.width := 50;
TPA[0].size.height := 20;
TPA[1] := Potato(10,15,40,40);
writeln(TPA);
end.
2012-05-25 11:08:36
From: masterBB
TPA:TPotatoArray;
snip…
TCoal = record
Color, Tol: Integer;
x, y: Integer;
Use: Boolean;
end;
if TCoal.Use then
begin
FindColorsTolerance(TPA, TCoal.Color, MMX1, MMY1, MMX2, MMY2, TCoal.Tol);
aTPA := SplitTPAEx(TPA, TCoal.x, TCoal.y);
//blah blah blah
end;
2012-05-25 11:11:33
From: Runaway
already you're probably a type master,
2012-05-25 11:15:55
From: masterBB
snip…

2012-05-25 11:42:44
2012-05-25 12:17:40
type
TCharArray = Array Of Char; //Just a type.. TCharArray is defined as an array of chars.
type
FoodStruct = record //A record is a class.. Classes hold one-to-many data types.
FoodDTM: Integer;
FoodUptext: TStringArray;
end;
var
FS: FoodStruct; //Global Classes..
Procedure FoodInfo(Which: String); //Does not return a type.. instead it adds to the global FS.
begin
Case Lowercase(Which) Of
'shark':
begin
FS.FoodDTM:= DTMFromString('..............'); //Maybe a Shark DTM?
FS.FoodUptext:= ['ark', 'hark', 'Shark'];
end;
'lobster':
begin
//Same as before.. Different uptext..
end;
end;
end;
Function ReturnFoodInfo(Which: String): FoodStruct; //Returns a class aka Foodstruct.
begin
Case Lowercase(Which) Of
'shark':
begin
Result.FoodDTM:= DTMFromString('..............'); //Maybe a Shark DTM?
Result.FoodUptext:= ['ark', 'hark', 'Shark'];
end;
'lobster':
begin
//Same as before.. Different uptext..
end;
end;
end;
var
SomeFood: FoodStruct;
begin
SomeFood:= ReturnFoodInfo('shark'); //we use our return foodinfo.
if FindDTM(SomeFood.FoodDTM, X, Y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(X, Y, 0, 0);
if WaitUptextMulti(SomeFood.FoodUptext, 600) then .........
end;
//OR We can use the global one..
FoodInfo('shark');
If FindDTM(FS.FoodDTM, X, Y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(X, Y, 0, 0);
If waitUptextMulti(FS.FoodUptext, 600) then ..............
end;
end.