weaselforce
2006-03-26 00:36:05
kk well a few days ago i decided i would learn a little more about scar scripting and make my own script. Its a big perspective change from just leeching scrips all the time lol. so anyways, i didnt get to finish it. well i kinda messed it up by not using srl setup from the beginning due to me not understanding properly what was to be done with SRL.
I attempted this project to basically practice designing scripts and learn alot. Some of my code is probably really bad or confusing, but if you have any suggestions, comments, changes, I would GREATLY appreciate it.
I Couldnt finish it because scar lags reallly bad when i use this script, i have no reason why…anyone know? so the first few procedures work fine cause i could test them, but it went too slow afterward to continue testing. Heres my vial filler script ( i chose a vial filler cause i had 300 empty vials and i thought it might be a nice easy first script )
procedures dont have wait times and main loop is incomplete
I attempted this project to basically practice designing scripts and learn alot. Some of my code is probably really bad or confusing, but if you have any suggestions, comments, changes, I would GREATLY appreciate it.
I Couldnt finish it because scar lags reallly bad when i use this script, i have no reason why…anyone know? so the first few procedures work fine cause i could test them, but it went too slow afterward to continue testing. Heres my vial filler script ( i chose a vial filler cause i had 300 empty vials and i thought it might be a nice easy first script )
procedures dont have wait times and main loop is incomplete
// ***** Weasel's First Script ***** \\
// \\
// Super Neato Awesome Vial Filler! \\
{-------------------------------------------}
// Special thanks to SRL Team for making this possible :)
// And thanks to SDcit for answering my many noobie questions :)
program VialFiller;
{.include SRL/SRL.scar}
const
//Set the Colors here\\
watercolour = 0; //fountain Color
filledvialcolor = 11964297;// What a filled vial looks like
emptyvials = 250;//how many vials you have
RoadColour = 0;
var Watersymbol,Rcolor,TotalDone,VialsToDo:integer;
// ***Arrange Ingame*** \\
procedure arrange;
Begin
SetupSrl;
Face('N');
SetRun(true);
ChatsOff;
wait(100);
end;
// ***loading the water symbol bitmap*** \\
procedure LoadBitmaps;
var Watersymbol:integer;
begin
watersymbol:= BitmapFromString(7, 11, 'AAC4B78BA3A5B3C2E16' +
'E7AA2717D97BFCAD0AEBBA9BCD5D1B7CDD87786AF596595919BBE' +
'939FADBAC6BC9BB2C0A5BAD53E4D86545F9F858FC2ABB6D4A6B1B' +
'79EB5D57287B46A78C3404B9D97A0E5BDC7F8A1ACC29CB2E48093' +
'D54653B1424BB04950A8A8B1F4BAC3EA6B80BF4659A5B2BFFF4B5' +
'5C43F47A98089D6A1ABDC6E85C8A7BAFF9FABFF6771E4161E831C' +
'2574BCC8FC4860A04F65B1AFBDFF4753C3283293333F8B7D8BBA6' +
'17CB1384F925363C2323FA52733892E3C7D8696BA86A3CB395288' +
'1F318312227A3848936676AA9EAFC9A6C4DE93AFD78EA2E7889AE' +
'68597D592A4CCA5B8C6');
end;
procedure Watersymboloff;
begin
FreeBitmap(watersymbol)
end;
// ***Settin Up Colors and such** \\
procedure startup;
var TotalDone:integer;
begin
If LoggedIn then
begin
Rcolor:=RoadColour
TotalDone := 0
VialsToDo := emptyvials;
end
else
begin
writeln('didnt sense you as being logged in')
writeln('Please log in and try again')
end;
end;
// ***walkin twords fountain***
procedure walktofountain;
var waterx,watery:integer;
begin
repeat
RoadWalk(Rcolor,'NW');
until (FindBitmap(watersymbol,waterx,watery));
begin
MoveMouseSmooth(waterx,watery);
clickMouse(waterx,watery,true);
Wait(random(30)+40);
clickMouse(waterx,watery,true);
end;
end;
//***Check Colors and start Vial Filling***\\
procedure StartAndColorCheck;
begin
if FindMSColorTol(x,y,watercolour,5)then
begin
writeln('colors worked fine,beginning loop');
end
else
begin
writeln('Couldnt Locate the Fountain or Fountain Colors');
writeln('please make sure fountain was insight');
writeln('and or please check your colors');
Logout;
end;
end;
//***Fill Vials***\\
procedure FillVials;
begin
UseItem(28);
ClickMSColorTol(watercolor,5,true);
wait(random (100)+1000);
if FindItemColorTol(filledvialcolor,5) then
begin
end
else
begin
writeln('vial color wrong, either set it yourself')
writeln('you can disable this whole procedure if you like')
writeln('or else my..[Shock] script messed up! [/Shock]')
logout;
end;
end;
//***Return To Bank And Deposit All***\\
procedure ReturnToBankAndDeposit;
var Gettime:integer;
begin
Gettime:= GetSystemTime;
repeat
RoadWalk(Rcolor,'SE');
until(FindMMColor(x,y,bankcolor));
if(GetSystemTime-Gettime >= 4000)then
Begin
writeln('got lost heading to bank')
writeln('Autostopped to avoid you ending in alkahrid')
writeln('Please restart script, make sure all goes well')
writeln('If failed again, script probably broken or bank crowded')
CloseWindow;
Logout;
end
else
begin
FindBank('veb');
if Bankscreen then
begin
DepositAll;
TotalDone := +28
VialsToDo := -28
end
else
writeln('didnt let you access bank')
writeln('Please check the pin constant')
writeln('please restart script')
writeln('bank may be too crowded...')
writeln('if it still wont work probably busted')
end;
end;
//***Withdraw from bank***\\
procedure Withdrawfrombank;
begin
OpenBank;
if Bankscreen then
if TotalDone < emptyvials-28 then
begin
FixBank;
withdraw(1,1,0);
end
else
begin
withdraw(1,1,VialsToDo-1);
writeln('doing your last set of vials, less than 28')
end
else
begin
writeln('didnt let you access bank')
writeln('Please check the pin constant')
writeln('bank may be too crowded')
writeln('please restart script')
writeln('if it still wont work probably busted')
CloseWindow;
logout;
end;
end;
//***Uses Srl Randoms***\\
procedure randoms;
begin
FindNormalRandoms;
wait(random (50)+50)
FindMiscRandoms;
end;
//***mainloop***\\
Begin
startup;
arrange;
withdrawfrombank;
randoms;
loadbitmaps;
//walktofountain;
//startandcolorcheck;
//randoms;
//watersymboloff;
//fillvials;
//ReturnToBankAndDeposit;
//randoms;
end.