-
Notifications
You must be signed in to change notification settings - Fork 4
/
GameCalls.cs
73 lines (55 loc) · 1.71 KB
/
GameCalls.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/// <filename>: GameCalls.cs
/// <author>: Bloom
/// <description>: List of useful flash calls not included in rbot yet
using RBot;
public class Testingclass {
public ScriptInterface bot => ScriptInterface.Instance;
public void ScriptMain(ScriptInterface bot) {
HideMonsters(true);
ShowFPSCounter(true);
SetFPS(60);
}
/// <summary>
/// Sets the game FPS
/// </summary>
/// <param name="FPS"> Frames per second </param>
public void SetFPS(int FPS) {
bot.SetGameObject("stage.frameRate", FPS);
}
/// <summary>
/// Hides the monsters for performance
/// </summary>
/// <param name="Value"> true -> hides monsters. false -> reveals them </param>
public void HideMonsters(bool Value) {
switch(Value) {
case true:
if (!bot.GetGameObject<bool>("ui.monsterIcon.redX.visible")) {
bot.CallGameFunction("world.toggleMonsters");
}
return;
case false:
if (bot.GetGameObject<bool>("ui.monsterIcon.redX.visible")) {
bot.CallGameFunction("world.toggleMonsters");
}
return;
}
}
/// <summary>
/// Shows FPS counter
/// </summary>
/// <param name="Value"> true -> hides fps. false -> reveals them </param>
public void ShowFPSCounter(bool Value) {
switch(Value) {
case true:
if (!bot.GetGameObject<bool>("ui.mcFPS.visible")) {
bot.CallGameFunction("world.toggleFPS");
}
return;
case false:
if (bot.GetGameObject<bool>("ui.mcFPS.visible")) {
bot.CallGameFunction("world.toggleFPS");
}
return;
}
}
}