Page 1 of 2 12 LastLast
Results 1 to 25 of 30

Thread: Another question lol :D

  1. #1
    Join Date
    Mar 2007
    Posts
    132
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Another question lol :D

    Now i need help again.
    Now at the Cutting procedure i need to make a Case. In the beginning of the script the user will write what gem to cut in a const. So i need a Case that will choose which DTM it needs to search. How do i do that?
    http://www.fenjer.com/adnan/SRLStats/877.png
    The Fabis Uber banner has been updated so it works in the latest SRL versions -->Fastest baning script ever!

  2. #2
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You could make it check for a DTM of an uncut gem (When it doesn't find any, that means it's done). Like find out how long it usually takes to cut a full inventory (lets say 30 seconds). Then do something like

    SCAR Code:
    begin
      CutGems;
      MarkTime(cutting);
      wait(25000);
      repeat
        wait(2000);
      until not (FindDTM(uncutgem,x,y,x1,y1,x2,y2) or (TimeFromMark > 40000)
    end;

    You get what I'm saying?

  3. #3
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    repeat
    Wait(120);
    FindNormalRandoms;
    until(CountItems(CutGemDTM, 'dtm', [0])=AmountToCut);

    I think that'd work.
    Make a DTM named CutGemDTM, which is a DTM of the an already cut gem. lol.

  4. #4
    Join Date
    Mar 2007
    Posts
    132
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Im a total newb at DTM's. I've read a few tutorials, but still don't get it.
    If someone could explain to me ^_^
    http://www.fenjer.com/adnan/SRLStats/877.png
    The Fabis Uber banner has been updated so it works in the latest SRL versions -->Fastest baning script ever!

  5. #5
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    DTMs are basically pictures of an object. It uses specific dots around the object. If these dots are the same, then it found the DTM.

    It's kind of hard to explain...

  6. #6
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    To make a dtm, get an image of what you want to make a dtm of.

    Then, while having the DTM tutorial open btw because this is brief:

    1. Go Tools > DTM Editor
    2. Edit Load Image
    3. Find a colored mainpoint preferably in the center. Click it.
    4. On the right, make the tolerance about 10.
    5. Click 4-6 subpoints on the image, which are the black outline.
    6. Save the dtm if you want to. Else, just go File > DTM To Text

    Hope I helped!
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  7. #7
    Join Date
    Mar 2007
    Posts
    132
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hmm okay ill try to use that ^_^
    Umm...
    Now i need help again.
    Now at the Cutting procedure i need to make a Case. In the beginning of the script the user will write what gem to cut in a const. So i need a Case that will choose which DTM it needs to search. How do i do that?
    http://www.fenjer.com/adnan/SRLStats/877.png
    The Fabis Uber banner has been updated so it works in the latest SRL versions -->Fastest baning script ever!

  8. #8
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Nava2 View Post
    To make a dtm, get an image of what you want to make a dtm of.

    Then, while having the DTM tutorial open btw because this is brief:

    1. Go Tools > DTM Editor
    2. Edit Load Image
    3. Find a colored mainpoint preferably in the center. Click it.
    4. On the right, make the tolerance about 10.
    5. Click 4-6 subpoints on the image, which are the black outline.
    6. Save the dtm if you want to. Else, just go File > DTM To Text

    Hope I helped!
    Very helpful. You're a great member of the SRL-Forums community.
    Rep+.

    And, yes, please do follow his instructions, fabis.

  9. #9
    Join Date
    Mar 2007
    Posts
    132
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok another problem:

    Now i need help again.
    Now at the Cutting procedure i need to make a Case. In the beginning of the script the user will write what gem to cut in a const. So i need a Case that will choose which DTM it needs to search. How do i do that?

    Would it be like this? (it goes at LoadDTMS procedure at the beginning)

    Whatgame is a const at the beginning. You write what gem you want to cut, in it.

    SCAR Code:
    case Whatgem of
      'sapphire' : GemDTM := DTMFromString('78DA631463606010654001FC22D50C5C409A1' +
              '188FF030123485E81010D302291401AA48187801A4920C14B8439' +
              '3204D4C8020969026A3830FD85AE0600A4A905D0');
      'emerald' : GemDTM := DTMFromString('123612387123612873126312312312312' +
                     '123123213213213213213213213213123123123123123123123' +
                     '324325234627834632874632746327846723483246');

    Would that work?
    http://www.fenjer.com/adnan/SRLStats/877.png
    The Fabis Uber banner has been updated so it works in the latest SRL versions -->Fastest baning script ever!

  10. #10
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    case LowerCase(WhatGem) of
      'sapphire' : begin
              GemDTM := DTMFromString('78DA631463606010654001FC22D50C5C409A1' +
              '188FF030123485E81010D302291401AA48187801A4920C14B8439' +
              '3204D4C8020969026A3830FD85AE0600A4A905D0');
                   end;
      'emerald' : begin
            GemDTM := DTMFromString('123612387123612873126312312312312' +
            '123123213213213213213213213213123123123123123123123' +
            '324325234627834632874632746327846723483246');
                  end;
    end;

    But I have a feeling that Emerald DTM isn't real..

  11. #11
    Join Date
    Mar 2007
    Posts
    132
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well i tested it :/
    It worked :P

    So here is the complete Procedure. Would it work then?

    SCAR Code:
    procedure LoadDTMs;
    begin
     case Whatgem of
      'sapphire' : GemDTM := DTMFromString('78DA631463606010654001FC22D50C5C409A1' +
              '188FF030123485E81010D302291401AA48187801A4920C14B8439' +
              '3204D4C8020969026A3830FD85AE0600A4A905D0');
      'emerald'  : GemDTM := DTMFromString('78DA631463606010604001FCA5C20C5C409A1' +
           '188FF03012388C3CE8006189148202D05243808A8910512E204D4' +
           '70030929026A8480840C01351C98FE42570300886B05AA');
      'ruby'     : GemDTM := DTMFromString('78DA6314656060106040016962BC0C5C409A1' +
           '188FF0301232790C1CE8006189148202D05243809A8910112E204' +
           'D470000951026A8481840C0135200F48E157030078F3059F');
      'diamond'  : GemDTM := DTMFromString('78DA631461606010604001B3A64E61E002D28' +
           'C40FC1F0818D9810C0E0634C0884402694920C149408D14909022' +
           'A08693083582404286801A364C7FA1AB0100921D06CD');

    end;
    end;

    I mean if i would write ruby in the Whatgem const, it would only load Ruby DTM?
    http://www.fenjer.com/adnan/SRLStats/877.png
    The Fabis Uber banner has been updated so it works in the latest SRL versions -->Fastest baning script ever!

  12. #12
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Almost, you just need to make it a function, not a procedure -
    SCAR Code:
    function LoadDTMs(Whatgem: string);
    begin
     case Whatgem of
      'sapphire' : GemDTM := DTMFromString('78DA631463606010654001FC22D50C5C409A1' +
              '188FF030123485E81010D302291401AA48187801A4920C14B8439' +
              '3204D4C8020969026A3830FD85AE0600A4A905D0');
      'emerald'  : GemDTM := DTMFromString('78DA631463606010604001FCA5C20C5C409A1' +
           '188FF03012388C3CE8006189148202D05243808A8910512E204D4' +
           '70030929026A8480840C01351C98FE42570300886B05AA');
      'ruby'     : GemDTM := DTMFromString('78DA6314656060106040016962BC0C5C409A1' +
           '188FF0301232790C1CE8006189148202D05243809A8910112E204' +
           'D470000951026A8481840C0135200F48E157030078F3059F');
      'diamond'  : GemDTM := DTMFromString('78DA631461606010604001B3A64E61E002D28' +
           'C40FC1F0818D9810C0E0634C0884402694920C149408D14909022' +
           'A08693083582404286801A364C7FA1AB0100921D06CD');

      end;
    end;

    So when you want to load, lets say the ruby DTM. Just do

    SCAR Code:
    LoadDTMs('ruby');

    And don't forget to free the DTM. Do

    SCAR Code:
    FreeDTM(GemDTM);

    After you don't need it anymore.


    But, actually, you could have just made one DTM, with the center point at a tolerance of 355, then it would find any uncut gem

  13. #13
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by Runescapian View Post
    Almost, you just need to make it a function, not a procedure -
    SCAR Code:
    function LoadDTMs(Whatgem: string);
    begin
     case Whatgem of
      'sapphire' : GemDTM := DTMFromString('78DA631463606010654001FC22D50C5C409A1' +
              '188FF030123485E81010D302291401AA48187801A4920C14B8439' +
              '3204D4C8020969026A3830FD85AE0600A4A905D0');
      'emerald'  : GemDTM := DTMFromString('78DA631463606010604001FCA5C20C5C409A1' +
           '188FF03012388C3CE8006189148202D05243808A8910512E204D4' +
           '70030929026A8480840C01351C98FE42570300886B05AA');
      'ruby'     : GemDTM := DTMFromString('78DA6314656060106040016962BC0C5C409A1' +
           '188FF0301232790C1CE8006189148202D05243809A8910112E204' +
           'D470000951026A8481840C0135200F48E157030078F3059F');
      'diamond'  : GemDTM := DTMFromString('78DA631461606010604001B3A64E61E002D28' +
           'C40FC1F0818D9810C0E0634C0884402694920C149408D14909022' +
           'A08693083582404286801A364C7FA1AB0100921D06CD');

      end;
    end;
    Functions have to return something. In this case, there's no need to, really, so having it as a procedure works fine.
    :-)

  14. #14
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Method View Post
    Functions have to return something. In this case, there's no need to, really, so having it as a procedure works fine.
    Got confused with the DTM

    So instead of function LoadDTMs(Whatgem:string) do procedure LoadDTMs(Whatgem: string).

  15. #15
    Join Date
    Mar 2007
    Posts
    132
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Im confused...
    What do i need to do with the LoadDTM? I just need to add it in the beginning of the Mainloop like this:
    SCAR Code:
    LoadDTMs(Whatgem);

    Or like this:

    SCAR Code:
    LoadDTMs;

    ???
    What exactly i do with it?
    Cuz i have that Whatgem const in the beginning. The user writes in, what gem does he want to cut (sapphire, emerald, ruby or diamond).

    So wouldnt it be correct to add LoadDTMs(Whatgem); somewhere in the beginning after DeclarePlayers in the mainloop?
    http://www.fenjer.com/adnan/SRLStats/877.png
    The Fabis Uber banner has been updated so it works in the latest SRL versions -->Fastest baning script ever!

  16. #16
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SORRY FOR THIS UGLY LAYOUT + BAD GRAMMAR + CAPS() + THE REST, BUT I HAD SPARE TIME ^^ THE CODE MIGHT BE NOT WORKING I TYPED EVERYTHING IN HERE .



    SCAR Code:
    PROCEDURE LoadDTMs(Whatgem: string);
    begin
     case LOWERCASE(Whatgem) of
      'sapphire' : GemDTM := DTMFromString('78DA631463606010654001FC22D50C5C409A1' +
              '188FF030123485E81010D302291401AA48187801A4920C14B8439' +
              '3204D4C8020969026A3830FD85AE0600A4A905D0');
      'emerald'  : GemDTM := DTMFromString('78DA631463606010604001FCA5C20C5C409A1' +
           '188FF03012388C3CE8006189148202D05243808A8910512E204D4' +
           '70030929026A8480840C01351C98FE42570300886B05AA');
      'ruby'     : GemDTM := DTMFromString('78DA6314656060106040016962BC0C5C409A1' +
           '188FF0301232790C1CE8006189148202D05243809A8910112E204' +
           'D470000951026A8481840C0135200F48E157030078F3059F');
      'diamond'  : GemDTM := DTMFromString('78DA631461606010604001B3A64E61E002D28' +
           'C40FC1F0818D9810C0E0634C0884402694920C149408D14909022' +
           'A08693083582404286801A364C7FA1AB0100921D06CD');
     
      end;
    end;

    Use that like:
    SCAR Code:
    LoadDTMS('ruby')
    If finddtm(GEMDTM,etc,etc,etc)

    That should work.

    But u also could do in the player array.

    SCAR Code:
    Players[0].Strings[0].'Ruby';// Fill in ur gem

    Then do
    SCAR Code:
    PROCEDURE LoadDTMs;
    begin
     case LOWERCASE(Players[0].Strings[0]) of
      'sapphire' : GemDTM := DTMFromString('78DA631463606010654001FC22D50C5C409A1' +
              '188FF030123485E81010D302291401AA48187801A4920C14B8439' +
              '3204D4C8020969026A3830FD85AE0600A4A905D0');
      'emerald'  : GemDTM := DTMFromString('78DA631463606010604001FCA5C20C5C409A1' +
           '188FF03012388C3CE8006189148202D05243808A8910512E204D4' +
           '70030929026A8480840C01351C98FE42570300886B05AA');
      'ruby'     : GemDTM := DTMFromString('78DA6314656060106040016962BC0C5C409A1' +
           '188FF0301232790C1CE8006189148202D05243809A8910112E204' +
           'D470000951026A8481840C0135200F48E157030078F3059F');
      'diamond'  : GemDTM := DTMFromString('78DA631461606010604001B3A64E61E002D28' +
           'C40FC1F0818D9810C0E0634C0884402694920C149408D14909022' +
           'A08693083582404286801A364C7FA1AB0100921D06CD');
     
      end;
    end;

    And u use it the same as above:

    SCAR Code:
    LoadDTMS('ruby')
    If finddtm(GEMDTM,etc,etc,etc)

    Or

    This is what I use,
    SCAR Code:
    Function GetFoodDTM:Integer;
    Begin
      Case LowerCase(WhatToCook) Of //u can replace WHatToCook with Players[Currentplayer].string[0] u know ;)
      'trout': DTMFromString('78DA633CC4C8C0F09F0105ECDFBA954104480' +
           '36518FE0301E366208B9D11551103231209A441E6B01250731EC8' +
           'FACE805FCD1E20EB370135BB812C0EFC760100484D0DD6');
      'salmon': DTM := DTMFromString('78DA633CC4C8C0F09F01056C2FCB641001D24' +
           '01986FF40C0B819C862674455C4C0884402699039AC04D49C07B2' +
           'BE33E057B307C8FA4D40CD6E208B03BF5D00D8890D43');
      End;
    End;


    This is different
    SCAR Code:
    If finddtm(GetFoodDTM,etc,etc,etc,etc....) then

    But now i don't remember how to free the dtm then... so don't use it
    ~Hermen

  17. #17
    Join Date
    Mar 2007
    Posts
    132
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Why should i write LoadDTMs('ruby'); Then the user will only be able to craft rubies. Thats why i have the Whatgem const. It needs to be LoadDTMs(Whatgem);

    AND wtf is the Lowercase thingy?

    Why cant i just let the LoadDTMs procedure stay as it is. And then at the GemCutting procedure add LoadDTMs; or LoadDTMs(Whatgem); at the beginning.
    http://www.fenjer.com/adnan/SRLStats/877.png
    The Fabis Uber banner has been updated so it works in the latest SRL versions -->Fastest baning script ever!

  18. #18
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    They're talking crap now - no need to make it have an input string if you already have the string stored globally elsewhere for it, so it should just be LoadDTM, not LoadDTM('ruby') or anything like that. I am worried though that you should be making a multiplayer script, in which case you would want it to do "case Player[currentPlayer].Strings[0] of" and make it an option for all your players in declare players.
    You will also want to add Lowercase, because Scar sees Ruby and ruby as different strings, so what lowercase will do is change all letters to lowercase, meaning that Ruby or RuBy or RUBY etc. is changed into ruby, thus allowing the case to work better - so would be "case Lowercase(Player[currentPlayer].Strings[0] of" for the start of the case for LoadDTM.
    To add the multiplayer string to each you would have the following line at the bottom of the player[i] section (replacing i with all the values for the players you have):
    Player[i].Strings[0] := 'Ruby';
    or
    Player[0].String[0] := 'None';
    With the second meaning nothing will be cut as you won't have a nothing DTM
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  19. #19
    Join Date
    Mar 2007
    Posts
    132
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Wow thanks Mixster ^_^
    Thats just what i wanted to know. Ok ill see what i can do...
    http://www.fenjer.com/adnan/SRLStats/877.png
    The Fabis Uber banner has been updated so it works in the latest SRL versions -->Fastest baning script ever!

  20. #20
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    if Lowercase(Players[CurrentPlayer].Strings[0])='none' then Exit;

  21. #21
    Join Date
    Mar 2007
    Posts
    132
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh and would FreeDTM procedure look like this?

    SCAR Code:
    procedure FreeDTMs;
    begin
     case Lowercase(Players[currentplayer].Strings[1]) of
      'sapphire' : FreeDTM(GemDTM);
      'emerald'  : FreeDTM(GemDTM);
      'ruby'     : FreeDTM(GemDTM);
      'diamond'  : FreeDTM(GemDTM);

    end;
    end;
    http://www.fenjer.com/adnan/SRLStats/877.png
    The Fabis Uber banner has been updated so it works in the latest SRL versions -->Fastest baning script ever!

  22. #22
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    No, just FreeDTM(GemDTM);

    No need for a case. They were all declared as GemDTM;.

  23. #23
    Join Date
    Mar 2007
    Posts
    132
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok thanks. Now i have a problem with this case:

    SCAR Code:
    case Whichbank of
      'akb'  : begin
               Writeln('Opening Al Kharid bank.');
               MakeCompass('e');
               OpenBankFast('akb');
               Writeln('Opened Al Kharid bank.');
               end;
      'lb'   : begin
               Writeln('Opening Lumbridge bank.');
               MakeCompass('w');
               OpenBankFast('lb');
               Writeln('Opened Lumbridge bank.');
               end;
      'veb'  : begin
               Writeln('Opening Varrock East bank.');
               MakeCompass('n');
               OpenBankFast('veb');
               Writeln('Opened Varrock East bank.');
               end;
      'vwb'  : begin
               Writeln('Opening Varrock west bank.');
               MakeCompass('e');
               OpenBankFast('vwb');
               Writeln('Opened Varrock west bank.');
               end;
      'feb'  : begin
               Writeln('Opening Falador East bank.');
               MakeCompass('n');
               OpenBankFast('feb');
               Writeln('Opened Falador East bank.');
               end;
      'fwb'  : begin
               Writeln('Opening Falador west bank.');
               MakeCompass('n');
               OpenBankFast('fwb');
               Writeln('Opened Falador west bank.');
               end;
      'db'  : begin
               Writeln('Opening Draynor Village bank.');
               MakeCompass('n');
               OpenBankFast('db');
               Writeln('Opened Draynor Village bank.');
               end;
      'eb'  : begin
               Writeln('Opening Edgeville bank.');
               MakeCompass('w');
               OpenBankFast('eb');
               Writeln('Opened Edgeville bank.');
               end;
        end;

    Im at VWB and when it needs to Rorate the Compass, it makes it East, but then makes it back to North. Why?
    http://www.fenjer.com/adnan/SRLStats/877.png
    The Fabis Uber banner has been updated so it works in the latest SRL versions -->Fastest baning script ever!

  24. #24
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    OpenBankFast('vwb'); changes it back to North.

    You don't really need to change the direction from North...It's pretty much pointless..

  25. #25
    Join Date
    Mar 2007
    Posts
    132
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well it doesn't find the bank booths :/
    Thats why i need to rotate the camera
    http://www.fenjer.com/adnan/SRLStats/877.png
    The Fabis Uber banner has been updated so it works in the latest SRL versions -->Fastest baning script ever!

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. i has a question
    By Solkrieg in forum OSR Help
    Replies: 5
    Last Post: 10-30-2008, 08:20 AM
  2. tab 5 question
    By dvdcrayola in forum OSR Help
    Replies: 4
    Last Post: 07-04-2008, 06:43 AM

Posting Permissions

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