Jump to content
Ranqers

Need a, simple,(?) function.

Recommended Posts

@Freddy, well i'm not sure exactly what i want. :x

 

i can't get anything to work inside the SMART client. it loads the client correctly but when i type in a command like "ClickMouse(i,e);" it will not respond (not do anything).

so i'm guessing its not being targeted correctly? or if it is at all?

 

><

 

edit: was asking for this function to trouble shoot this problem. ^^

Edited by Ranqers
Link to comment
Share on other sites

The SMART client does not control your mouse or keyboard. It has its own, and you use it (send commands to it) through SCAR.

 

You can tell where the mouse is, by a red dot it will show from time to time...

 

Try one of the testing files for RS2:

Like this one for testing gametabs, if you fill this out and run it. It will Log in for you, then mess with your game tabs (music, prayer, etc.) It won't do anything crazy though so you should be fine testing it out:

 

https://raw.github.com/OSI1/OSI1/master/RS2/Testing/GameTabsFunctions.scar

 

[scar]

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Official SCAR Include

GameTabs Function Testing

--------------------------------------------------------------------------------

* procedure TestGameTabsFunctions;

Last Modified: October 6th, 2012. By LordJashin. RS2 Build 735.

* Instructions:

1. Set the constants

2. Run Test!

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

 

{$DEFINE RS2}

{$DEFINE SMART}

{$I ../../OSI.scar}

 

const

RS2_Username = 'Test'; // Set these constants before running!

RS2_Password = 'Test';

RS2_Member = False; // Use Member's world?

SMART_World = 11; // What world do you want to go to?

 

// Do not include this file. Run it!

 

procedure SetupPlayers;

begin

SetLength(Players, 1);

with Players[0] do

begin

Login := RS2_Username;

Pass := RS2_Password;

Member := RS2_Member;

WorldInfo:= [RS2_Member, SMART_World];

Active := True;

end;

SetupOSI;

if not LoggedIn then

Login;

wait(5000);

end;

 

procedure TestGameTabsFunctions;

var

ColorState: string;

begin

OSI_WriteAndLog('GetCurrentTab: Result: ' + IntToStr(GetCurrentTab));

if GetTabBounds(0) <> Box(0, 0, 0, 0) then OSI_WriteAndLog('GetTabBounds: Works!') else OSI_WriteAndLog('GetTabBounds: Failed!');

if TabExists(0) then OSI_WriteAndLog('TabExists: Tab(0) Exists!') else OSI_WriteAndLog('TabExists: Tab(0) doesn''t exist or Failed!');

if SetGameTab(0) then OSI_WriteAndLog('SetGameTab: Clicked Game Tab(0)') else OSI_WriteAndLog('SetGameTab: Didn''t Click GameTab(0) or Failed!');

if GetEquipmentBounds(0) <> Box(0, 0, 0, 0) then OSI_WriteAndLog('GetEquipmentBounds: Works!') else OSI_WriteAndLog('GetEquipmentBounds: Failed!');

if IsSlotEquipped(Tab_Equip_Boots, True) then OSI_WriteAndLog('IsSlotEquipped: Boots are equipped!') else OSI_WriteAndLog('IsSlotEquipped: Boots are not equipped or Failed!');

if ClickEquipedItem(Tab_Equip_Boots, ClickLeft, True) then OSI_WriteAndLog('ClickEquipedItem: Clicked equipped Boots!') else OSI_WriteAndLog('ClickEquipedItem: Didn''t Click equipped Boots or Boots were not Equipped or Failed!');

OSI_WriteAndLog('GetCurrentMusic: Result: ' + GetCurrentMusic);

if IsRunning then OSI_WriteAndLog('IsRunning: Yes!') else OSI_WriteAndLog('IsRunning: No or Failed!');

if SetRun(True) then OSI_WriteAndLog('SetRun: Running!') else OSI_WriteAndLog('SetRun: Didn''t turn on running or Failed!');

if IsResting then OSI_WriteAndLog('IsResting: Resting!') else OSI_WriteAndLog('IsResting: Is not resting or didn''t find resting or Failed!');

if SetRest then OSI_WriteAndLog('SetRest: Is Now Resting!') else OSI_WriteAndLog('SetRest: Didn''t start resting or Failed!');

if IsMoneyPouchOpen then OSI_WriteAndLog('IsMoneyPouchOpen: Yes!') else OSI_WriteAndLog('IsMoneyPouchOpen: No or Failed!');

if ToggleMoneyPouch(True) then OSI_WriteAndLog('ToggleMoneyPouch: Opened Money Pouch if it was closed!') else OSI_WriteAndLog('ToggleMoneyPouch: It was already open or Failed!');

OSI_WriteAndLog('GetMoneyPouchAmount: Result: ' + IntToStr(GetMoneyPouchAmount));

if WithdrawMoneyPouch(1) then OSI_WriteAndLog('WithdrawMoneyPouch: Withdrew 1 gold!') else OSI_WriteAndLog('WithdrawMoneyPouch: Didn''t withdraw 1 gold or Failed!');

if IsXPBarOpen then OSI_WriteAndLog('IsXPBarOpen: Yes!') else OSI_WriteAndLog('IsXPBarOpen: No or Failed!');

if ToggleXPBar(true) then OSI_WriteAndLog('ToggleXPBar: Opened XP Bar if it was closed!') else OSI_WriteAndLog('ToggleXPBar: It was already open or Failed!');

OSI_WriteAndLog('GetXPBarTotal: Result: ' + IntToStr(GetXPBarTotal));

OSI_WriteAndLog('ConvertXPToLevel: From total: ' + IntToStr(ConvertXPToLevel(GetXPBarTotal)));

if GetSkillBounds(0) <> Box(0, 0, 0, 0) then OSI_WriteAndLog('GetSkillBounds: Works!') else OSI_WriteAndLog('GetSkillBounds: Failed!');

OSI_WriteAndLog('GetSkillLevelEx: Skill_Attack: ' + IntToStr(GetSkillLevelEx(Skill_Attack, False, True)));

OSI_WriteAndLog('GetSkillLevel: Skill_Attack: ' + IntToStr(GetSkillLevel(Skill_Attack, True)));

OSI_WriteAndLog('GetMMLevelEx: Skill_Attack: ' + IntToStr(GetMMLevelEx(Skill_Attack, ColorState)));

OSI_WriteAndLog('GetMMLevel: Skill_Attack: ' + IntToStr(GetMMLevel(Skill_Attack)));

if HoverSkill(Skill_Attack, True) then OSI_WriteAndLog('HoverSkill: Mouse to Attack!') else OSI_WriteAndLog('HoverSkill: No Mouse to Skill_Attack or Failed!');

OSI_WriteAndLog('GetXP: Skill_Attack: ' + IntToStr(GetXP(Skill_Attack, True)));

if GetAllLevels(True) then OSI_WriteAndLog('GetAllLevels: Stored to current player') else OSI_WriteAndLog('GetAllLevels: Couldn''t get all levels or Failed!');

// GetSkillInfo

end;

 

begin

SetupPlayers;

ClearDebug;

MoveMouse(0, 0);

TestGameTabsFunctions;

end.

[/scar]

 

Note: You must have OSI (Official SCAR Include) through In SCAR: File->Includes Manager

 

Here is a template for using SMART with OSI, uses it for RS2:

 

[scar]

program New;

 

{$DEFINE RS2}

{$DEFINE OSI_Color_Anti_Randoms}

{$DEFINE SMART} // Comment out to disable SMART

// and use browser instead

{$I OSI\OSI.scar}

 

procedure ScriptTerminate;

begin

FreeOSI;

end;

 

begin

SetUpOSI;

end.

[/scar]

Edited by LordJashin
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...