Small update with some fixes and additions:
The new feature for version 4.1 is the ability to find the IDs for map items (the ones you click for some quests) in the grabber, it’s functionality can be used in scripts too, returning a list with a new object that you will learn bellow.
Note: This method uses FFDec which requires Java 8, which can be found here In the Loader (Tools > Loaders) you can select the “Map Item IDs” and click grab from any map. This will download, read and parse the data to a list of MapItem object, which has the following properties:
Property | Type | Description |
---|---|---|
MapItemID |
int | The ID of the map item. |
MapName |
string | The name of the map. |
MapFilePath |
string | The path of the map file. |
QuestID |
int | The quest where the map item is required. |
You can use the method MapItem#ToString()
to return a string formatted like Item ID [{MapItemID}], Quest [{QuestID}]
with each respective variable filled with the map item info.
If you want to, you can also call the method ScriptInterface#Map.FindMapItems()
that will return a list of map items while running a script.
Additionally, this saves all data in a Json file inside the folder Tools/Cache
so you don’t need to keep downloading/reading/parsing the same file multiple times, I would also like to remember you can right click any item in the loader to see multiple options of what you can do with the grabbed data, you can also select multiple items and Ctrl click those buttons to pop up quantity prompts.
For those who weren’t RBot users back then, there was a window where you could find scripts from all botmakers. This window was removed since most were outdated and the way it worked didn’t allow what I had in mind for how scripts should be, so I ditched the window and you have been downloading them directly from github. Well, this is fine, but with this reworked functionality you can update your scripts directly from the client using the Get Scripts window (click the button in the Scripts window). You can still open the github browser page by Ctrl clicking the Get Scripts button.
From
ScriptInterface#Map
.
Property | Type | Description |
---|---|---|
LastMap |
string | The name of the last map joined in the session. |
MapFilePath |
string | The path of the last map file. |
MapFileName |
string | The name of the map file, from the MapFilePath. |
MapFileTown |
string | The town of the map (usually the region of the map, the first part of MapFilePath) |
From
ScriptInterface#Options
.
Property | Type | Description |
---|---|---|
AttackWithoutTarget |
bool | Setting this to true will make it use the skills even without target. Use with caution. |
AcceptACDrops |
bool | When enabled will pickup any AC item that drops, even when the drop should be rejected. |
From
ScriptInterface#Monsters
.
Method Definition | Return Type | Description |
---|---|---|
CurrentAvailableMonsters() |
List<Monster> | Gets a list of all the monsters in the current cell that can be attacked. |
From
ScriptInterface#Player
.
Method Definition | Return Type | Description |
---|---|---|
PickupACItems() |
void | Picks up all AC tagged items. |
The version 4 of RBot is a breakthrough for me, in it we can work with all the improvements that came with .NET 6. This includes faster compilation/recompilation and better performance overall out of the box. The changelog is big so if you want specific info use the table of contents above.
Note: to run this version of RBot you will need the .NET 6 Desktop Runtime and ASP.NET Core Runtime which you can find here.
Porting to .NET 6 gives a lot of improvements but as RBot still uses the Windows Forms there is some missing packages that were not updated to work in .NET 6. The problems are listed bellow, and they will not be fixed:
In the main menu of RBot at the right corner you can see a new button: “Auto”. This button allow you to acess the interface bellow:
At the top is the status of the auto attack/hunt, if it is running it will tell you so. The numbered items works as follow:
Note: Starting the attack/hunt method will automatically enable the drops, quest completion and boosts if any of these are setup.
|
);|
) or a comma (,
);The loader is pretty much the same but with a lot more functions attached to it than before:
It is possible to filter the packets now so you don’t see the the spam of skills while trying to get an important packet. Although there is a tooltip balloon, I was trolled by WinForms so it doesn’t show long enough, each check box filter out the respective packets:
You can also right click the list of packets to clear the current selections.
There is some new events to be listened for, you can access then in ScriptInterface#Events
ScriptInterface#Events.ItemDropped
: Occurs when an item is dropped or added to your inventory;ScriptInterface#Events.ScriptStopping
: Occurs after the script is stopped, you can put any cleanup code in that event;Also, there is another 2 I will explain how to use:
Some monsters have a counter attack mechanic that requires your player to stop attacking it so it doesn’t die
public void ScriptMain(ScriptInterface bot)
{
// You assign a method to be called when a counter attack is detected
bot.Events.CounterAttack += CounterAttackHandler;
/*
Code
*/
}
public void CounterAttackHandler(ScriptInterface bot, bool faded)
{
// If faded is false it means the Counter Attack is about to start,
// inside it you should handle what the bot should do.
if(!faded)
{
// We cancel the player attack as expected;
bot.Player.CancelAutoAttack();
bot.Player.CancelTarget();
// if there is anything more you wanna do when the counter attack starts you can add it here
/*
Code
*/
}
// If faded is true then the Counter Attack finished,
// you can then tell the bot the specific actions after that.
else
{
// When the counter attack fades, we attack it again.
bot.Player.Attack("*");
// here we also can make it do anything we want.
/*
Code
*/
}
}
The run to area mechanic is a very niche skill currently only in Ledgermayne and Ultra Dage, which require the player to run to a safe zone that is highlighted in the map. To make use of this event you can use just like the CounterAttack:
public void ScriptMain(ScriptInterface bot)
{
// You assign a method to be called when a run to area packet is detected
bot.Events.RunToArea += RunToAreaHandler;
/*
Code
*/
}
public void RunToAreaHandler(ScriptInterface bot, string zone)
{
// Here we will filter which zone is the highlighted one
switch (zone.ToLower())
{
// 'A' is the left zone, so we use a walk command to move our player to the desired coordinates:
case "a":
bot.Player.WalkTo(changeToXPosition, changeToYPosition, speed: 8); // The speed is optional with a max of 32, use with caution as it can ban you.
break;
// 'B" is the right zone;
case "b":
bot.Player.WalkTo(changeToXPosition, changeToYPosition, speed: 8);
break;
// By default (empty string) we can use it to center our character in the screen so we get time to run to the next highlighted area.
default:
bot.Player.WalkTo(changeToXPosition, changeToYPosition, speed: 8);
break;
}
}
InventoryItem
now has an integer property to check the enhancement level of the item, you can access it by InventoryItem#EnhancementLevel
;ShopItem
has a similar one for level, you can access it by ShopItem#Level
.ItemBase#ItemGroup
: The filter group of the item. co = Armor; ba = Cape; he = Helm; pe = Pet; Weapon = Weapon;InventoryItem#EnhancementPatternID
: A number that reflects which enhancement is currently applied to an item;ShopItem#Faction
: The faction needed to buy this item;ShopItem#RequiredReputation
: The needed reputation amount to buy this item (goes from 0 to 302500);ShopItem#Requirements
: Requirements to buy merge items;Monster#MaxHP
: The maximum health points of the monster;
ScriptInterface#Stop
method to stop the script, it works just like calling ScriptManager.StopScript()
.ScriptInterface#Options.RetryRelogin
, it is true by default and will try to re-login 3 times;ScriptInterface#Inventory.GetTempItemById
method added;ScriptInterface#Quests.CanComplete
method now also checks if you have all the required items instead of only relying in a game property that is not being updated correctly;ScriptInterface#Player.Relogin
method added, it returns a whether the relogin was successful;ScriptManager.RestartScript
method work as intended;ShopCache.Loaded
list used to see the information of loaded shops inside scripts/plugins;VSCode has “built in” methods to create an project for .NET 6, here I will show you how to make VSC able to autocomplete your projects.
dotnet new classlib
and press enter, it will create the .csproj needed for the referencing;<ItemGroup>
<Reference Include="RBot">
<HintPath>$Path to your RBot dll$\RBot.dll</HintPath>
</Reference>
</ItemGroup>
After replacing with your RBot dll path, it should look like this:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Reference Include="RBot">
<HintPath>D:\Rbot-4\RBot.dll</HintPath>
</Reference>
<!-- If you need to reference something from winforms, add this too. -->
<Reference Include="System.Windows.Forms">
<HintPath>C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Windows.Forms.dll</HintPath>
</Reference>
</ItemGroup>
</Project>
You can do it to as many folders as you want, if you want multiple of them open at the same time search for VSCode Workspaces.
This update was made exclusively by Purple. The changes and fixes are listed bellow:
From
ScriptInterface#Inventory
;
Property | Description |
---|---|
Slots |
The total number of inventory slots the player has. |
UsedSlots |
The number of inventory slots that are currently in use. |
FreeSlots |
The number of free inventory slots the player has. |
Those properties return integers that can help you manage the player inventory in your script.
ScriptInterface#Options
now has options to change the NameColor
and GuildColor
. Both accepts HEX values (0xFFFFFF);ScriptInterface#SendWhisper(string name, string message)
: Sends a whisper to the specified name;ScriptInterface#SendMSGPacket(string message, string sentBy, string messageType)
: Sends a message in chat. Message type can be: moderator, warning, server, event, guild, zone and whisper;ScriptInterface#Bank.UsedSlots
to use the right function;ScriptInterface#Player.Join
no longer recurse indefinitely, the max amount of recursions is now 3;All files related to converting gbots to scripts have been removed as the final product of said conversions are not realiable and easy to edit after converted.
The changes that don’t need an explanation are listed bellow.
ScriptInterface#Options.SetFPS
added to set the maximum game FPS;ScriptInterface#Options.ShowFPS()
added to toggle the FPS counter;House items can be grabbed in the Loaders and scripted, the methods added are:
From
ScriptInterface#Inventory
Method | Return type | Description |
---|---|---|
ContainsHouseItem(string item) |
bool | Checks if the House Inventory contains the specified item. |
HouseItemToBank(string item) |
void | Sends the house item to bank. |
GetHouseItemByName(string name) |
RBot.Items.InventoryItem | Gets a reference to the specified house item in the player’s house inventory. |
GetHouseItemById(int id) |
RBot.Items.InventoryItem | Gets a reference to the specified house item in the player’s house inventory. |
TryGetHouseItem(int id, out InventoryItem houseItem) |
bool, out RBot.Items.InventoryItem | Attempts to get the item by the given id and sets the out parameter to this value. |
TryGetHouseItem(string name, out InventoryItem houseItem) |
bool, out RBot.Items.InventoryItem | Attempts to get the item by the given name and sets the out parameter to this value. |
IsHouseItemEquipped(string name) |
bool | Checks if the given house item is equipped. |
Bank versions are not needed as all items go to the same bank inventory and use the same packet to send to inventory.
You are getting ping spikes and that is breaking you script? Now you can override the timeouts used by SafeTimings setting the property ScriptInterface#Wait.OverrideTimeout
to true
. When setted to true the wait method will use the timeouts listed bellow:
Note: The number you see multiplies WAIT_SLEEP (250ms), so a ActionTimeout of 10 will wait for 2500ms (2,5 seconds). Please don’t set values bellow the default ones as this can cause script/game instability.
// This will override any action timeout made by the Player:
// "ForPlayerPosition(float, float, int)"
// "ForCombatExit(int)"
public int PlayerActionTimeout { get; set; } = 10;
// This will override any action timeout related to monsters:
// "ForMonsterSpawn(string, int)"
public int MonsterActionTimeout { get; set; } = 10;
// This will override any action timeout related to maps:
// "ForMapLoad(string, int)"
// "ForCellChange(string)"
public int MapActionTimeout { get; set; } = 20;
// This will override any action timeout related to drops:
// "ForPickup(string, int)"
// "ForDrop(string, int)"
public int DropActionTimeout { get; set; } = 10;
// This will override any action timeout related to items:
// "ForItemBuy(int)"
// "ForItemSell(int)"
// "ForItemEquip(string, int)"
// "ForItemEquip(int, int)"
// "ForBankToInventory(string, int)"
// "ForInventoryToBank(string, int)"
public int ItemActionTimeout { get; set; } = 14;
// This will override any action timeout related to quests:
// "ForQuestAccept(int, int)"
// "ForQuestComplete(int, int)"
public int QuestActionTimeout { get; set; } = 14;
// This will override any action timeout related to game actions:
// "ForActionCooldown(GameActions, int)"
// "ForActionCooldown(string, int)"
public int GameActionTimeout { get; set; } = 40;
Main form now has a “Jump” overlay just like the previous Jump window where you can get your current cell or jump to others, with it you can:
"{MapName}", "{Cell}", "{Pad}"
;"{Cell}", "{Pad}"
.“Jump” window now has predefined fast travels for tercess locations, Binky and Museum Crossroads (Awe Enhancements). You can also add custom fast travels that will be saved in the application options. The usage is simple:
In the text box at the bottom you can add where you wanna go, it must be comma (‘,’) separated for it to be added. The accepted format will look something like this: Display name, MapToJoin, Cell, Pad
where display name can be anything you want to describe the place you are joining.
Four (4) parameters are the maximum accepted but you can add them like:
underworld
will join underworld;Join Underworld, battleon
will also join underworld but the display name will be “Join Underworld”);underworld, s1, Left
will join underworld and jump to the Dage’s room. Note that 3 inputs expect that inputs 2 and 3 are Cell and Pad respectively;Dage, underworld, s1, Left
will join underworld and jump too the Dage’s room. It’s display name will be “Dage”.After adding it you can click the “Go” button to join the selected fast travel in the combo box, this button can be used like:
Note: Holding ctrl while clicking any of the predefined fast travels will also join a private room.
Core Skill plugin is now implemented inside RBot and are saved to RBot folder/Skills/AdvancedSkills.txt
, more info on how to use can be seen here. This will allow you and bot makers to provide skill sets.
It’s now possible to create multiple lists of options for your scripts, allowing categorized options to be shown at script start. To set it up you will need to create the option fields explained here and an aditional field (public string[] MultiOptions
) that will list the fields you want to be used as options:
// Like in the default setup, we specify the file name.
public string OptionsStorage = "Multi Option Test";
// This field is optional.
public bool DontPreconfigure = false;
// We set a string array with the names of the options list.
// At runtime underscores will be replaced by spaces in the Option Window that pop up.
public string[] MultiOptions = { "First", "Second_List", "Third_List" };
// You need to match the names listed in the array above so they can be compiled
public List<IOption> First = new List<IOption>()
{
new Option<string>("name", "Name", "Name of your character", "Rick Astley"),
new Option<string>("link", "Link", "A not even suspicious link", "https://www.youtube.com/watch?v=dQw4w9WgXcQ")
};
public List<IOption> Second_List = new List<IOption>()
{
new Option<int>("never", "Never", "Gonna give you up", 1337)
};
public List<IOption> Third_List = new List<IOption>()
{
new Option<string>("never", "Never", "Never gonna let you down", "Rick Astley but from Third_List")
};
public List<IOption> Options = new()
{
new Option<string>("normal", "Normal Option", "This is a normal option", "Normal")
};
When running a script with the above options, they will appear in the options window pop up like this:
To get the values from a multi option storage it’s pretty much like a simple option, the only difference is that you need to specify from which list it will come from. This allow us to have multiple options with the same name but from different lists:
public void ScriptMain(ScriptInterface bot)
{
bot.Options.SafeTimings = true;
bot.Options.RestPackets = true;
bot.Options.InfiniteRange = true;
bot.Options.ExitCombatBeforeQuest = true;
// Like getting from a normal option, we call the Get method with the type of the value we are trying to get.
// The first parameter is the name of the list the option is, the second is the name of the option.
bot.Log(bot.Config.Get<string>("First", "name"));
// As said before this allow same option names aslong they are not in the same list.
bot.Log(bot.Config.Get<int>("Second_List", "never").ToString());
bot.Log(bot.Config.Get<string>("Third_List", "never"));
// Normal options don't need a list name as they belong to the same place.
bot.Log(bot.Config.Get<string>("normal"));
}
With all that after running the scrip for this example the values of the options will be logged:
The file for it will be included in the 3.6.2 release
You edit scripts with the built in Editor but don’t like the light theme of it? If you wanna be a hackerman and use IntelliSense/Omnisharp word completion, I’m going to walk you through how to setup VSCode to help you with it.
Note: you might need the Developer Pack for .NET Framework 4.8 AND 4.7.2 to be able to open the VSCode-Scripts in VSCode.
There you can paste the following settings inside the curly braces:
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 10000,
"csproj.itemType": {
"*": "Compile",
".ts": "TypeScriptCompile"
},
"csproj.silentDeletion": true,
The first 2 lines will set autosave to each 10 seconds (optional). The csproj ones will 1. set included files to be compiled (needed for autocomplete) and 2. automatically delete any file you delete from the csproj.
Now we are finished, if you don’t like the default dark mode of VSCode you can always download themes in the Extensions tab, some nice dark mode themes are listed here.