Results 1 to 10 of 10

Thread: Help editing scripts?

  1. #1
    Join Date
    Apr 2012
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Help editing scripts?

    Hellow everyone, I'm really new to PASCAL and haven't much scripting experience but I've watched many tutorials and I'm getting the hang of things, though I can sort of understand what a script is saying I'm far from writing one.

    I'd like to edit a script I'm using at the moment to drop "strange rock" when ever it sees one as it freezes the script. Could someone give me some direction in how to do this? I know I'd have to create DTM's for it but I dont understand where I would then implement that into the rest of the code also not entirely sure what it means to free DTM's.

    Any help would be great!

  2. #2
    Join Date
    Nov 2011
    Location
    MA
    Posts
    545
    Mentioned
    3 Post(s)
    Quoted
    10 Post(s)

    Default

    You'd create a DTM of the strange rock and then create a procedure like..:

    Simba Code:
    var
      StrangeRock, x, y: Integer;

    begin
      StrangeRock := DTMFromString('Edit this');
      if ExistsItemDTM(StrangeRock, x, y) then
      begin
        Mouse(x, y, 15, 15, mouse_right);
        WaitOption('rop', 700);
      end;
      FreeDTM(StrangeRock);
    end.

  3. #3
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Ok do you know what a DTM is?
    it would be used to recognise the rock in your inventory, if you find it then you want to drop it via right clicking it
    Simba Code:
    if RockIsInInvent then
      begin
        RightClickInventorySpot
        ClickDrop
      end;

    there are some quite big clues to it

  4. #4
    Join Date
    Apr 2012
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by tehq View Post
    You'd create a DTM of the strange rock and then create a procedure like..:

    Simba Code:
    var
      StrangeRock, x, y: Integer;

    begin
      StrangeRock := DTMFromString('Edit this');
      if ExistsItemDTM(StrangeRock, x, y) then
      begin
        Mouse(x, y, 15, 15, mouse_right);
        WaitOption('rop', 700);
      end;
      FreeDTM(StrangeRock);
    end.
    Okay so I've created the DTM and procedure, now how would I implement this into the main loop?

  5. #5
    Join Date
    Apr 2007
    Location
    Rimmington
    Posts
    168
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    you should need to just find the best place to slot it in say before you start to chop a tree it will do a quick search for the rock and would be as simple as including the procedure name in to the main loop.

    as for freeing DTM's its to avoid overloading you computers memory i think think off loading them as filling a glass once its full you will need to empty it to fill it again.

    (correct me if im wrong)
    Learning To Code - So Excuse the n00b questions!

  6. #6
    Join Date
    Apr 2012
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by tubs-12 View Post
    you should need to just find the best place to slot it in say before you start to chop a tree it will do a quick search for the rock and would be as simple as including the procedure name in to the main loop.

    as for freeing DTM's its to avoid overloading you computers memory i think think off loading them as filling a glass once its full you will need to empty it to fill it again.

    (correct me if im wrong)
    Thanks for that! So the best way to do this would be in a an "if" function? or to tie it in to the main loops repeat as an"until"?

  7. #7
    Join Date
    Apr 2012
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Since there are over 15 different strange rocks and I don't have time to create DTM's for them all would it be more efficient to create a procedure that recognises any item in my inventory that isnt either money, maple logs(noted) or maple logs? Then if it does see a foreign item it will just right click and either drop/destroy. Could someone give me some advice in creating this sort of a procedure?

  8. #8
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    "If the player wishes not to receive rocks any more, they may speak to Barnabus Hurma to toggle them off if desired. "

    From rs wiki, just turn it off so you wont have to deal with it

  9. #9
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    You only get 2 strange rocks from each skill. If you just bank 2 of the strange rocks you won't get them anymore.

  10. #10
    Join Date
    Apr 2007
    Location
    Rimmington
    Posts
    168
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    i would disable the strange rocks but if you really want to the procedure i would have 3 DTMZ money, maple logs(noted) and unnoted

    then check invent slot 1 2 & 3 for the acording DTMZ if found carry on ELSE Drop invent slots that are not 1 2 or 3 (checking first that there is more than 3 items in your inventory)

    tell me if i am not making sence =]
    Learning To Code - So Excuse the n00b questions!

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
  •