SRL Archive - OSR Help

How to edit core functions?


Master BAW

2012-07-14 15:51:45

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 :(

Master BAW

2012-07-14 15:56:45

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;

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.

Le Jingle

2012-07-14 16:05:54

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/Simba/blob/master/Units/MMLCore/finder.pas

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

Master BAW

2012-07-14 16:24:54

From: Le Jingle
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/Simba/blob/master/Units/MMLCore/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?

Runaway

2012-07-14 16:27:34

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


{ 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:


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;

Master BAW

2012-07-14 16:33:08

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


{ 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? :p :duh:
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:


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…

Runaway

2012-07-14 16:45:52

From: MasterCrimez
I thought you couldn't edit globals? That's why they are globals right? :p :duh:
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 :blink: Have you tried compiling this? I don't think it will. You'll have to give all of the vars a different name:


var
vMSX1, vMSX2, vMSY1, vMSY2: Integer;

// ...

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

From: MasterCrimez
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 ;)

Master BAW

2012-07-14 16:52:55

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


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 :D


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..

Runaway

2012-07-14 17:06:43

From: MasterCrimez
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 :)

Master BAW

2012-07-14 17:11:23

From: Runaway
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 .. :)

masterBB

2012-07-14 17:20:21

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

Master BAW

2012-07-14 17:31:53

From: masterBB
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 :p so Lazarus is a program to make a .exe from the core files (like another Simba.exe)?

euphemism

2012-07-14 17:34:20

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.

Le Jingle

2012-07-14 18:15:56

From: euphemism
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