Results 1 to 4 of 4

Thread: Variables?

  1. #1
    Join Date
    Dec 2011
    Location
    Holland
    Posts
    455
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default Constants?

    Hello SRL

    I am working on my script for SIN's competition and i want to make some constants, but i can't really get them to work.

    The variable is:

    Simba Code:
    const
        WaitTime = '';
          //Desired time to wait after clicking a guard
          //Determine this by checking it yourself (depends on cb level)
          //WaitTime = '1000' Means the script will wait 1 s after clicking the guard

    The piece of code where it should be added (check WaitTime in the code after clicking):

    Simba Code:
    procedure FightGuards;
    var x, y, i: Integer;
        Guard: Array [0..13] of Integer;
    begin
      Writeln('Looking for a Guard');
      Guard[0] := DTMFromString('mQwAAAHicY2ZgYDgDxKeA+DwQrwDipUC8HIhtra0ZvNzcGAz09Bj4gXwQZkTDQAAANLYGlA==');
      Guard[1] := DTMFromString('mQwAAAHicY2ZgYIhnZGBIAeIEIPYE8t2B2AdEW4kyeNuJM9ibCDPAAD8QMyJhIAAAqicD1A==');
      Guard[2] := DTMFromString('mQwAAAHicY2ZgYJBmZGCQBGI5IK4D8quBuAaIo8PDGRLjYsEYBviBmBEJAwEAyLcFIQ==');
      Guard[3] := DTMFromString('mQwAAAHicY2ZgYGBkZGD4B6T/AnEAEPsCcTAQ11ZWMORlZYJpGOAHqUfCQAAAK6gHIA==');
      Guard[4] := DTMFromString('mQwAAAHicY2ZgYPgKxJ+A+DMQezAyMHgCsSsQWxkqMLhbqzP4OWozwAA/EDMiYSAAABO8Bbc=');
      Guard[5] := DTMFromString('mQwAAAHicY2ZgYDgGxIeh2IWRgcEdiJ2A2FRHliFZS44hyFWXAQb4gZgRCQMBAPDzBR8=');
      Guard[6] := DTMFromString('mQwAAAHicY2ZgYDgPxKeB+BIQbwPinVBaWVmaQUFBAoxhgB+IGZEwEAAAGnoFuA==');
      Guard[7] := DTMFromString('mQwAAAHicY2ZgYNBnZGDQAmIDIH7BAMFvgVhHR4lBWVmaQVNTgQEG+IGYEQkDAQDPmwSs');

      for i:= 0 to 7 do
      If FindDTM(Guard[i], x, y, MSX1, MSY1, MSX2, MSY2) then
      begin
        Writeln('Guard found KILL IT!');
        MMouse(x,y,0,0);
        Wait(50 + (random(50)));
        repeat
          Wait(50 + random(50));
          case Random(2) of
          0:
            begin
              Mouse(x,y,0,0,false);
              ChooseOption('ttac');
              Writeln('Derpin it like a baws');
              Wait(WaitTime + Random(1000));
            end;
          1:
            Begin
              Mouse(x,y,0,0,true);
              Writeln('Derpin it like a baws');
              Wait(WaitTime + Random(1000));
            end;
          end;
        until (InFight) or (not OthersInFight) or (not LoggedIn)
      end;
      FreeDTM(Guard[0]);
      FreeDTM(Guard[1]);
      FreeDTM(Guard[2]);
      FreeDTM(Guard[3]);
      FreeDTM(Guard[4]);
      FreeDTM(Guard[5]);
      FreeDTM(Guard[6]);
      FreeDTM(Guard[7]);
    end;

    I would really appreciate the help!

    greetz
    Last edited by okokokok; 02-22-2012 at 07:16 PM.
    07Scripter
    I mostly write private scripts

  2. #2
    Join Date
    Dec 2008
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    you have
    Simba Code:
    const
        WaitTime = '';
    should be
    Simba Code:
    const
        WaitTime = 1000; // example of waiting one second
    no '' on it that's like saying Wait('5000');
    if it was for example
    Simba Code:
    const
      WhatToWrite = 'boobs'; //then it would have ''

    procedure boobs;
    begin
      WriteLn(WhatToWrite);
    end;

    begin
      boobs;
    end.
    Last edited by poopy2177; 02-22-2012 at 07:41 PM.
    My Soul Wars Scipt Proggress:[100%....]
    Probably won't release though I like it for myself

  3. #3
    Join Date
    Dec 2011
    Location
    Holland
    Posts
    455
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Ok thanks for your help, but i have one more question left.
    I want to make the script eat too, atm i use a lobster DTM, so the script will eat lobsters only atm. Do i have to make a procedure or something to support multiple foods for the script?
    07Scripter
    I mostly write private scripts

  4. #4
    Join Date
    Jun 2007
    Location
    Greenville, SC
    Posts
    1,149
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You dont have to but that would be better. And for the variables question, if you want to store a number in a constant, you dont need the little dashes because that is for surrounding a string. Like: FoodToUse = 'lobster';//options: lobster, swordfish, monkfish, shark

    You could do a procedure to load the food dtms and have the dtm variable be set globally(at the beginning of a script, not in a proc/func).
    Last edited by Runescape Pro; 02-23-2012 at 07:44 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •