• Log in or sign up for an account here: https://www.sythe.org/login

Help with about 'ALL' scripts

floor66

Member
Joined
Jan 26, 2007
Sythe Gold
0
Messages
32
Hello, i am a newbie to scar, and yes, i ask newbie questions, so here we go:

Take this example:

When i run it i get all errors etc.

Loaded all chars. (NPCChars, TradeChars, SmallChars, StatChars, UpChars)
Failed when compiling
Line 372: [Error] (15701:1): Unknown identifier 'otherrandom' in script D:\SCAR 3.11\Scripts\Wool's Power-Miner 1.08.scar

And more then this:

Line 484: [Error] (15813:1): Unknown identifier 'minerocks' in script D:\SCAR 3.11\Scripts\Wool's Power-Miner 1.08.scar

Code:
{ POWER-MINER V 1.08                      ___                       |
 _______         _______                  |   |\\\\\\\              |
 \      \   _   /      /                  |   |\\\\\\\\\\           |
  \      \_/ \_/      / ______   ______   |   |\\\\\\\\\\\\\        |
   \        _        / |   _  | |  _   |  |   |\\\\\\\\\\\\\\\\     |
    \      / \      /  |  |*| | | |*|  |  |   |\\\\\\\\\\\\\\\\\\\  |
     \____/   \____/   |______| |______|  |___|\\\\\\\\\\\\\\\\\\\\\|
                                                                    |
1. Set the constants                                                |
2. Set up Username & Password                                       |
3. Make sure character is by rocks you want to mine                 |
4. Drag crosshair to the RS Window and play                         |
                       Script by WOOL                               |
____________________________________________________________________|
                             NOTES:                                 |
I would suggest that you keep the constant switch to one to prevent |
so many randoms. Also, setting nickname for your user make you do   |
not use the first letter because its a capital in the game. Pick    |
does not need to be equipped but make sure you set the # of picks.  |
If you need to add more players delete the brackets things "{" and  |
change "Howmanyplayers" to the amount your useing                   |
                                                                    |
             Thx to all that helped along the way =]                |
____________________________________________________________________|                                                                   |
begin;

}
program Powerminer;
{.include SRL/SRL.scar }
{.include SRL/SRL/skill/Mining.scar }

var
loadsdroped,loads,gasrun,flee : integer;


//////////////////////////////BEGIN SETUP ////////////////////////////////

const
rockcolor=        13160660;    //Pick rock color
rockcolor2=       2174537;    //Pick Second color
rockcolor3=       2437713;    //Pick Third color
rockcolor4=       1976901;    //Pick Final color
pick=                true;    //        ***DONT TOUCH***
numberofpicks=          1;    //# of picks in Inv.
switch=                 1;    //         ***KEEP TO 1***
emptyore=              1;    //# of loads before end of script
timetowait=             3;    //Wait time in seconds, ajust to skill level
run=                  'N';    //Run direction

//////////////////////////////SET PLAYERS/////////////////////////////////

Procedure PickPlayers;
begin
     HowManyPlayers:=1;  //Change to the amount of players you use
     NumberOfPlayers(HowManyPlayers);

     Players[0].Name     :='';        //Enter your Username here
     Players[0].Pass     :='';      //Enter your Password here
     Players[0].Nick     :='';         //Enter your Nickname here
     Players[0].Active   := True;

     Players[1].Name     :='WOOl';        //Enter your Username here
     Players[1].Pass     :='******';      //Enter your Password here
     Players[1].Nick     :='OOl';         //Enter your Nickname here
     Players[1].Active   := True;

     Players[2].Name     :='WOOl';        //Enter your Username here
     Players[2].Pass     :='******';      //Enter your Password here
     Players[2].Nick     :='OOl';         //Enter your Nickname here
     Players[2].Active   := True;

     Players[3].Name     :='WOOl';        //Enter your Username here
     Players[3].Pass     :='******';      //Enter your Password here
     Players[3].Nick     :='OOl';         //Enter your Nickname here
     Players[3].Active   := True;

     //////////////////////EXTRA USERS HERE\\\\\\\\\\\\\\\\\\\\\\\\\
                    //Delete brackets if you use\\
     {
     Players[4].Name     :='WOOl';        //Enter your Username here
     Players[4].Pass     :='******';      //Enter your Password here
     Players[4].Nick     :='OOl';         //Enter your Nickname here
     Players[4].Active   := True;

     Players[5].Name     :='WOOl';        //Enter your Username here
     Players[5].Pass     :='******';      //Enter your Password here
     Players[5].Nick     :='OOl';         //Enter your Nickname here
     Players[5].Active   := True;

     Players[6].Name     :='WOOl';        //Enter your Username here
     Players[6].Pass     :='******';      //Enter your Password here
     Players[6].Nick     :='OOl';         //Enter your Nickname here
     Players[6].Active   := True;

     Players[7].Name     :='WOOl';        //Enter your Username here
     Players[7].Pass     :='******';      //Enter your Password here
     Players[7].Nick     :='OOl';         //Enter your Nickname here
     Players[7].Active   := True;
     }
 end;

//////////////////////////////END OF SETUP////////////////////////////////

procedure intro;
begin
cleardebug;
wait(500);
writeln(' _______         _______');
wait(200);
writeln(' \      \   _   /      /');
wait(200);
writeln('  \      \_/ \_/      /');
wait(200);
writeln('   \        _        /');
wait(200);
writeln('    \      / \      /');
wait(200);
writeln('     \____/   \____/OOL SCRIPTS');
wait(1000);
end;

//---------------------------------------------------------------------\\

function FindPickHead: Boolean; // By: Stupid3ooo/WT-Fakawi
var
  c,XH,YH,BR:integer;
  ReequipPick : Boolean;
begin
  GameTab(4);
  Result:=True;
  if(FindBitmapSpiralTolerance(PickHandle,x,y,550,200,745,465,30))or
    (GetColor(472,380)=0)and(GetColor(482,383)=0)then

  begin
    PerfectNorth;
    GameTab(5);
    Wait(1000);
    if (GetColor(604,300)=65536) and (GetColor(601,298)=65536) then
    begin
       NoPick:=True;
       writeln('Broken Pickaxe. NoPick:=True;');
       GameTab(4);
       Result:=False;
       BR:=1+Random(5);
       case BR of
        1: begin  TypeSend('arg'); end;
        2: begin  TypeSend('aarg'); end;
        3: begin  TypeSend('arghh'); end;
        4: begin  TypeSend('dam'); end;
        5: begin  TypeSend('gee.'); end;
       end;
       Exit;
    end;
    GameTab(4);

    Wait(2000+random(100));
    if(FindBitmapSpiralTolerance(Ore,x,y,559,210,735,460,25))then
    begin
      Mouse(x,y,5,5,false);
      ChooseOption(x, y, 'Drop');
    end;

    repeat
      if not(Loggedin) then exit;
       c:=c+1;
       x := random(510) + 5;
       y := random(330) + 5;
       if(FindColorSpiral(x, y, hc1, 3, 3, 515, 338))or
         (FindColorSpiral(x, y, hc2, 3, 3, 515, 338))or
         (FindColorSpiral(x, y, hc3, 3, 3, 515, 338))or
         (FindColorSpiral(x, y, hc4, 3, 3, 515, 338))or
         (FindColorSpiral(x, y, hc5, 3, 3, 515, 338))then
          begin
            MMouse(x,y,2,2);
            if IsUpText('Take') then begin
              GetMousePos(x, y);
              Mouse(x, y, 0, 0, true);
            end;
            Flag;
            wait(1000+random(100));
          end else
            if(PickUpItems)then
              ItemGrab;
    until((FindBitmapSpiralTolerance(PickHead,x,y,550,200,745,465,50)) or (c>=10) );
    if not (FindBitmapSpiralTolerance(PickHead,x,y,550,200,745,465,50)) then
    begin
         NoPick:=True;
         Result:=False;
         Exit;
    end;

    writeln('Found Head');
    GameTab(5);
    Wait(250);

    if FindBitmapSpiralTolerance(PickHandle,XH,YH,560,280,615,322,50) then
    begin
      writeln('Found Handle');
      Mouse(XH,YH,0,0,True);
      ReequipPick := True;
    end;

    Wait(250);
    GameTab(4);
    Wait(250);

    if(FindItemBmpTol(PickHead,50))and(FindItemBmpTol(PickHandle,50))then
    begin
      ClickItemBmpTol(PickHead,50,true);
      wait(1000);
      ClickItemBmpTol(PickHandle,50,true);
      PickAxeAttached:=PickAxeAttached+1;
      writeln('Attached Head & Handle');
      NoPick:=False;
      Result:=True;
      if ((EquipPick) or (ReequipPick)) then
      begin
        wait(3000);
        ClickItemColor(hc1,True);
      end;
    end;
  end;
end;

//---------------------------------------------------------------------\\

Procedure avoidban;
 var
 DontBan : Integer;
  begin
  if ( not ( LoggedIn )) then Exit;
   DontBan:=Random(45)
     case DontBan of
     1: RandomRClickEvery(2 + Random(15));
     2: LeaveScreenEvery(10 + Random(5));
     3: hoverskill('random', false);
     4: BoredEvery(9 + Random (21));
     5: PickUpMouse;
     6: LeaveScreenEvery(10 + Random(5));
     7: RotateEvery(20 + Random(5));
     8: RotateEvery(20 + Random(5));
     9: SayCurrentLevels('mining');
    10: RandomChatEvery(10 + Random(5));
    end;
  end;

//---------------------------------------------------------------------\\

procedure otherrandom;
 begin
  FindTalk;
  wait(3);
  FindDemon;
  Wait(3);
  FindMod;
  Wait(3);
  FindScapeRune;
  Wait(3);
  SolvePinball;
  Wait(3);
 if (not(loggedin)) then
 begin
 nextplayer(true);
 end;
end;

//---------------------------------------------------------------------\\

Procedure Respond;
begin
 if(InChat('Mining lvls')    or
    InChat('Mining lvl?')    or
    InChat('Mine lvls')      or
    InChat('Mlvls')          or
    InChat('Minin lvls')     or
    InChat('lvls')           or
    Inchat('Mine lvls?'))    then
  begin
    TypeSend(IntToStr(GetSkillLevel('Mining')))
  end;
 end;

//---------------------------------------------------------------------\\

function GassCheck:Boolean;
var gasx :integer;
    gasy :integer;
    RGWT :integer;
    TWG  :integer;

begin
 if (FindColorSpiralTolerance(gasx,gasy,rockcolor,210,130,300,220,5)) or
    (FindColorSpiralTolerance(gasx,gasy,rockcolor2,210,130,300,220,5)) or
    (FindColorSpiralTolerance(gasx,gasy,rockcolor3,210,130,300,220,5)) or
    (FindColorSpiralTolerance(gasx,gasy,rockcolor4,210,130,300,220,5)) then
    begin
    if not FindGas(gasx,gasy) then
     exit;
      if FindGas(gasx,gasy) then
       begin
        writeln('Found gas...');
         writeln('Running away from the rock.');
        RunAwayDirection(run);
        begin
        RGWT:=5+random(7);
        TWG:=0
         repeat
         TWG:=TWG+1;
          wait (1500+random(355));
         until(TWG=RGWT)
       Runback;
     Result:=True;
   end;
  end;
 end;
end;

//--------------------------------------------------------------------\\

Procedure Check;
 Begin
  If (WeareDead)then
  begin
   logout;
   Writeln('Found Dead, Logging Next Player')
   Players[CurrentPlayer].active := false
   nextplayer(true);
  end;
  If (FindScapeRune) then
  begin
   logout;
   Writeln('Fount ScapeRune, Logging Next Player')
   Players[CurrentPlayer].active := false
   nextplayer(true);
  end;
end;

//--------------------------------------------------------------------\\

procedure gas;
begin
  gasscheck;
 if(GasFound(x,y))then
  begin
  runawaydirection(run);
  runback;
  gasrun:=gasrun + 1
 end;
end;

//--------------------------------------------------------------------\\


Procedure fleefight;
 Begin
   if(findfight)then
   begin
    MouseSpeed := 3
    runawaydirection(run);
    flag;
    runback;
    flag;
    Flee:=Flee + 1
   end;
  end;

//--------------------------------------------------------------------\\

Procedure Dropore;
 begin
  findnormalrandoms;
  otherrandom;
  findtalk;
  Respond;
  fleefight;
  if (not(loggedin))then
  begin
  nextplayer(true);
  end;
  If (InvFull) Then
  begin
   If (Pick) Then
   DropTo(numberofpicks+1,28)
  else
   DropTo(numberofpicks+1,28)
    loadsdroped := loadsdroped + 1;
    loads:=loads + 1
    end;
     findtalk;
     avoidban;
     FindNormalRandoms;
     otherrandom;
     Respond;
     fleefight;
   end;

//--------------------------------------------------------------------\\

Procedure minerocks;
  begin
   findpick;
   findnormalrandoms;
   otherrandom;
   FindTalk;
   Respond;
   gas;
   fleefight;
   if (not(loggedin))then
  begin
  nextplayer(true);
  end;
   if (invfull) then
   begin
   FindTalk;
   otherrandom;
   findnormalrandoms;
   dropore;
   Respond;
   end;
    if(Findcolor(x,y,rockcolor,5,5,515,340))or
     (Findcolorspiral(x,y,rockcolor2,5,5,515,340))or
     (findcolor(x,y,rockcolor3,5,5,515,340))or
     (findcolorspiral(x,y,rockcolor4,5,5,515,340))then
   begin
   Gas;
   findpick;
   fleefight;
   Respond;
     Mouse(x,y,1,1,true)
     Wait(timetowait*1000+random(300))
   end;
  findnormalrandoms;
  otherrandom;
  avoidban;
  FindTalk;
  Respond;
  fleefight;
  end;


//--------------------------------------------------------------------\\

procedure PlayerReport;
var
Active : String;
begin
  writeln('^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^');
  writeln(' ');
  writeln(' ');
  writeln('******************PLAYER-REPORT*******************************');
  writeln('Player             = '+ Players[CurrentPlayer].Name);
  writeln('Number             = '+inttostr(CurrentPlayer));
  writeln('Mining Level       = '+ inttostr(GetSkillLevel('Mining')));
  writeln('Worked for         = '+IntToStr(Players[CurrentPlayer].Worked)+' minutes.');
  if Players[CurrentPlayer].Active=True then Active:='True' else Active:='False';
  writeln('Ran from gas       = ' + inttostr(gasrun));
  writeln('Active             = '+ Active);
  writeln('******************PLAYER-REPORT*******************************');
  writeln(' ');
  writeln(' ');
 end;

//--------------------------------------------------------------------\\

procedure Progreport;
begin
writeln('^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^');
writeln('')
writeln('')
writeln('*******************REPORT**************************')
writeln('Script ran for : ' + scripttime2 (2))
writeln('Droped ' + inttostr(loads) +  ' loads Total!')
writeln('*******************REPORT**************************')
writeln('')
writeln('')
writeln('^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^');
end;

//---------------------------------------------------------------------\\

procedure mainloop;
  begin
   repeat
    minerocks;
    if (invfull) then
    begin
    DropOre;
  end;
until (loadsdroped = switch)
 Loadsdroped:=0;
  PlayerReport;
  ProgReport;
  logout;
  NextPlayer(true);
  findpickheadcolor;
 if (findpickheadcolor=false) then
  begin
   Logout;
   Writeln('Could Not Find Pick, Logging Next Player');
   Players[CurrentPlayer].active := false
   Nextplayer(true);
  end;
 end;

//---------------------------------------------------------------------\\

begin
SetUpSRL;
SetUpSRLMining;
SRLRandomsReport;
intro;
PickPlayers;
loginplayer;
findpickheadcolor;
repeat
mainloop;
until(loads = emptyore)
writeln('               FINISHED     ')
Progreport;
writeln('               FINISHED     ')
end.

//----------------------------END SCRIPT--------------------------------\\
 
bump :D
 
Runescape Gamblingrunescape gambling
Back
Top