Results 1 to 14 of 14

Thread: How to edit core functions?

  1. #1
    Join Date
    Jun 2012
    Location
    THE Students-City of Holland
    Posts
    332
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default How to edit core functions?

    How to edit the colorfunctions and mousefunctions like countcolor and such? (I want to add the +50 pixels)
    But when I search "CountColor" in the functionlist, and I double click on it, nothing opens. With most functions the script of the function opens, but it seems that with some functions it doesn't
    Former Name: MasterCrimeZ.
    ToDo: 1. Finish my private bot 2. Make some cool bots for this community 3. Become a member
    If you have any questions about scripting, feel free to PM me

  2. #2
    Join Date
    Jun 2012
    Location
    THE Students-City of Holland
    Posts
    332
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Simba Code:
    Var
      OX, OY,
      MMX1, MMY1, MMX2, MMY2, MMCX, MMCY, MSX1, MSY1, MSX2, MSY2, MSCX, MSCY,
      MIX1, MIY1, MIX2, MIY2, MICX, MICY, MCX1, MCY1, MCX2, MCY2, MCCX, MCCY,
      MBX1, MBY1, MBX2, MBY2, DBX1, DBY1, DBX2, DBY2: integer;

    Simba Code:
    procedure DeterminePixelVariables;
    var
      //x,y : integer;
      FindBar : boolean;
    begin

      { vars OX, OY;
      Description: Offset from the left (x) and Offset from the top (y) }

      OX := 0;
    //  DTM := DTMFromString('mrAAAAHic42BgYGAGYg4gZmSAABYonxWIOaFi/FDMDBUHYR6oHk9tUQ'+
      //'YlWXEwFhfgYfh82I8h0kCMIUOfm8EDKEcIMBLAMAAAAV4FpA==');
    //  DTMFinding := FindDTM(DTM,x,y,400,0,500,60);
      FindBar := (GetColor(130, 7) = 994655);


      if FindBar then OY := 50 else OY := 23;
      //FreeDTM(DTM);
      {Please NB: this is just a quick fix. We can make this better.
      I will return to this subject later. //MasterCrimeZ }

      writeln('OX: '+IntToStr(OX)+'; OY: '+IntToStr(OY)+';');


    { vars MMX1, MMY1, MMX2, MMY2;
      Description: MiniMap Edge Points. }


      MMX1 := 550+OX;
      MMY1 := 8+OY;
      MMX2 := 703+OX;
      MMY2 := 161+OY;

    { vars MMCX, MMCY;
      Description: MiniMap Centre Point. }

      MMCX := round((MMX1+MMX2)/2);
      MMCY := round((MMY1+MMY2)/2);

    { vars MSX1, MSY1, MSX2, MSY2;
      Description: Main Screen EdgePoints. }

      MSX1 := 4+OX;
      MSY1 := 4+OY;
      MSX2 := 515+OX;
      MSY2 := 337+OY;

    { vars MSCX, MSCY;
      Description: Main Screen Centre Points. }

      MSCX := round((MSX1+MSX2)/2);
      MSCY := round((MSY1+MSY2)/2);

    { vars MIX1, MIY1, MIX2, MIY2;
      Description: Inventory EdgePoints. }

      MIX1 := 547+OX;
      MIY1 := 202+OY;
      MIX2 := 737+OX;
      MIY2 := 466+OY;

    { vars MICX, MICY;
      Description: Inventory Centre Points. }

      MICX := round((MIX1+MIX2)/2);
      MICY := round((MIY1+MIY2)/2)

    { vars MCX1, MCY1, MCX2, MCY2;
      Description: Chat Screen EdgePoints. }

      MCX1 := 4+OX;
      MCY1 := 342+OY;
      MCX2 := 514+OX;
      MCY2 := 475+OY;

    { vars MCCX, MCCY;
      Description: Chat Screen Centre Points. }

      MCCX := round((MCX1+MCX2)/2);
      MCCY := round((MCY1+MCY2)/2)

    { vars MBX1, MBY1, MBX2, MBY2;
      Description: BankScreen EdgePoints (where you click the items, does not include tabs). }

      MBX1 := 26+OX;
      MBY1 := 84+OY;
      MBX2 := 480+OX;
      MBY2 := 292+OY;

    { vars DBX1, DBY1, DBX2, DBY2;
      Description: Deposit box edgepoints (only where the item appear) }

      DBX1 := 91+OX;
      DBY1 := 57+OY;
      DBX2 := 443+OX;
      DBY2 := 262+OY;

    end;

    That's my fix btw. I only need to change those functions like Mmouse and all other mouse functions, and all color functions and then it's working.
    Former Name: MasterCrimeZ.
    ToDo: 1. Finish my private bot 2. Make some cool bots for this community 3. Become a member
    If you have any questions about scripting, feel free to PM me

  3. #3
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Don't know if you're familiar with this, however I believe you'd need to edit the core, found here:

    https://github.com/MerlijnWajer/Simb...ore/finder.pas

    *Disclaimer, noob onlookers/leeches don't go editing files willy-nilly without knowing what you are doing!

  4. #4
    Join Date
    Jun 2012
    Location
    THE Students-City of Holland
    Posts
    332
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by Le Jingle View Post
    Don't know if you're familiar with this, however I believe you'd need to edit the core, found here:

    https://github.com/MerlijnWajer/Simb...ore/finder.pas

    *Disclaimer, noob onlookers/leeches don't go editing files willy-nilly without knowing what you are doing!
    thanks, this is indeed the file with Countcolor and such. But not with the core mouse functions such as gaussbox etc.

    But I don't really understand, as i'm not really familiar with the Github thing... Where this files are on my computer? Or how I have to install these files?
    Last edited by Master BAW; 07-14-2012 at 08:27 PM.
    Former Name: MasterCrimeZ.
    ToDo: 1. Finish my private bot 2. Make some cool bots for this community 3. Become a member
    If you have any questions about scripting, feel free to PM me

  5. #5
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    First of all, you can just do this to edit the globals instead of looking them up and copy + pasting them:

    Simba Code:
    { vars MMX1, MMY1, MMX2, MMY2;
      Description: MiniMap Edge Points. }


      MMX1 := MMX1+OX;
      MMY1 := MMY1+OY;
      MMX2 := MMX2+OX;
      MMY2 := MMY2+OY;

      // ...

    ^ I also don't see the point of OX, but perhaps planning for future need is good...

    As for editing the core functions, it's really not possible to do privately. The only option you've got is to use wrappers or edited functions. For example, this is something you could do with GetMousePos:

    Simba Code:
    procedure GetMousePos_Offset(var x, y: Integer; xOffset, yOffset: Integer);
    begin
      GetMousePos(x, y);
      if (xOffset <> 0) or (yOffset <> 0) then
      begin
        x := x + xOffset;
        y := y + yOffset;
      end;
    end;

  6. #6
    Join Date
    Jun 2012
    Location
    THE Students-City of Holland
    Posts
    332
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by Runaway View Post
    First of all, you can just do this to edit the globals instead of looking them up and copy + pasting them:

    Simba Code:
    { vars MMX1, MMY1, MMX2, MMY2;
      Description: MiniMap Edge Points. }


      MMX1 := MMX1+OX;
      MMY1 := MMY1+OY;
      MMX2 := MMX2+OX;
      MMY2 := MMY2+OY;

      // ...

    ^ I also don't see the point of OX, but perhaps planning for future need is good...
    I thought you couldn't edit globals? That's why they are globals right?
    Yeah I thought OX might be needed in the future for example when Jagex is going to add random offsets every time you load RS (for example)
    As for editing the core functions, it's really not possible to do privately. The only option you've got is to use wrappers or edited functions. For example, this is something you could do with GetMousePos:

    Simba Code:
    procedure GetMousePos_Offset(var x, y: Integer; xOffset, yOffset: Integer);
    begin
      GetMousePos(x, y);
      if (xOffset <> 0) or (yOffset <> 0) then
      begin
        x := x + xOffset;
        y := y + yOffset;
      end;
    end;
    Thanks, this really helps.
    Can I overwrite the function GetMousePos? Because I don't want to change all GetMousePos in my script every time to GetMousePos_offset...
    Former Name: MasterCrimeZ.
    ToDo: 1. Finish my private bot 2. Make some cool bots for this community 3. Become a member
    If you have any questions about scripting, feel free to PM me

  7. #7
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by MasterCrimez View Post
    I thought you couldn't edit globals? That's why they are globals right?
    Yeah I thought OX might be needed in the future for example when Jagex is going to add random offsets every time you load RS (for example)
    Well, no, you can't. But you can't make a variable out of a global either Have you tried compiling this? I don't think it will. You'll have to give all of the vars a different name:

    Simba Code:
    var
      vMSX1, vMSX2, vMSY1, vMSY2: Integer;

    // ...

      vMSX1 := MSX1 + OX;
      vMSY1 := MSY1 + OY;
      vMSX2 := MSX2 + OX;
      vMSY2 := MSY2 + OY;

    Quote Originally Posted by MasterCrimez View Post
    Thanks, this really helps.
    Can I overwrite the function GetMousePos? Because I don't want to change all GetMousePos in my script every time to GetMousePos_offset...
    Nope, you can't overwrite core functions. They are compiled in the Simba exe. Are you really calling GetMousePos often enough for it to be a problem? If so you should probably make function out of it or something
    Last edited by Runaway; 07-14-2012 at 08:49 PM.

  8. #8
    Join Date
    Jun 2012
    Location
    THE Students-City of Holland
    Posts
    332
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by Runaway View Post
    Well, no, you can't. But you can't make a variable out of a global either Have you tried compiling this? I don't think it will. You'll have to give all of the vars a different name, like:

    Simba Code:
    var
      vMSX1, vMSX2, vMSY1, vMSY2: Integer;

    // ...

      vMSX1 := MSX1 + OX;
      vMSY1 := MSY1 + OY;
      vMSX2 := MSX2 + OX;
      vMSY2 := MSY2 + OY;
    Yes it will compile because I removed the globals from globals.simba

    Nope, you can't overwrite core functions. They are compiled in the Simba exe. Are you really calling GetMousePos often enough for it to be a problem? If so you should probably make function out of it or something
    Okay... then I think it's not really possible to make a fast fix myself (Or I have to add OY (and OX) to all coord-values when calling the function instead of inside the function itself , but I began doing that but it's too much to change..
    Former Name: MasterCrimeZ.
    ToDo: 1. Finish my private bot 2. Make some cool bots for this community 3. Become a member
    If you have any questions about scripting, feel free to PM me

  9. #9
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by MasterCrimez View Post
    Okay... then I think it's not really possible to make a fast fix myself (Or I have to add OY (and OX) to all coord-values when calling the function instead of inside the function itself , but I began doing that but it's too much to change..
    Might I suggest something? I have a different definition of "quick fix".

    Instead of taking the time to fix something that will be officially fixed eventually, you could always just make a static-coordinate based script in the meantime. For example, I've made an alcher for the time being while the fix is being handled

  10. #10
    Join Date
    Jun 2012
    Location
    THE Students-City of Holland
    Posts
    332
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by Runaway View Post
    Might I suggest something? I have a different definition of "quick fix".

    Instead of taking the time to fix something that will be officially fixed eventually, you could always just make a static-coordinate based script in the meantime. For example, I've made an alcher for the time being while the fix is being handled
    mhhmmh yea that's probably possible but it can't login or do much complicated stuff can it? because a lot of SRL functions also won't work yet...

    Anyway thanks for the help and I think I'll just wait for the fix then ..
    Former Name: MasterCrimeZ.
    ToDo: 1. Finish my private bot 2. Make some cool bots for this community 3. Become a member
    If you have any questions about scripting, feel free to PM me

  11. #11
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    In lape your can overwrite functions.

    Or, if you want to edit the core functions of simba, download the complete simba source and run it with lazarus 2.4.0/2.4.4
    Working on: Tithe Farmer

  12. #12
    Join Date
    Jun 2012
    Location
    THE Students-City of Holland
    Posts
    332
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by masterBB View Post
    In lape your can overwrite functions.

    Or, if you want to edit the core functions of simba, download the complete simba source and run it with lazarus 2.4.0/2.4.4
    What's lape ? Have seen this name come along much in this forum but still really don't know how it's different from pascal and how to use it in simba...
    Is there a tutorial maybe? (searched couldn't find)

    Okay that's cool so Lazarus is a program to make a .exe from the core files (like another Simba.exe)?
    Former Name: MasterCrimeZ.
    ToDo: 1. Finish my private bot 2. Make some cool bots for this community 3. Become a member
    If you have any questions about scripting, feel free to PM me

  13. #13
    Join Date
    Jun 2008
    Location
    United States
    Posts
    818
    Mentioned
    60 Post(s)
    Quoted
    90 Post(s)

    Default

    Guys, please search the forums for 'SetClientArea'; this is a function Wizzup? is writing that will be the official fix. I would link you to the thread, but I am on my mobile.
    [10/14/13:19:03] <BenLand100> this is special relatively, just cleverly disguised with yachts

  14. #14
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Quote Originally Posted by euphemism View Post
    Guys, please search the forums for 'SetClientArea'; this is a function Wizzup? is writing that will be the official fix. I would link you to the thread, but I am on my mobile.
    I believe this is the link:
    http://villavu.com/forum/showthread.php?t=86214

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
  •