-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcombat.oajs
More file actions
151 lines (121 loc) · 4.49 KB
/
Copy pathcombat.oajs
File metadata and controls
151 lines (121 loc) · 4.49 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
//#include config.oajs
//#include helpers.oajs
function AttackTarget(targetSerial) {
var targetSerial = targetSerial === undefined ? Orion.TargetSystemSerial() : targetSerial;
if (!Player.WarMode())
Orion.WarMode(true);
if (Orion.FindObject(targetSerial)) {
Orion.ShowStatusbar(targetSerial, _attack["statusBar"]["x"], _attack["statusBar"]["y"], false);
Orion.CharPrint(targetSerial, 20, "<< Target >>");
Orion.Attack(targetSerial);
if (_attack["follow"]) {
Orion.Follow(targetSerial);
}
}
}
function Attack() {
AttackTarget(Orion.TargetSystemSerial());
}
function AutoHealSelf() {
print("Healing at " + getPercentValue(Player.MaxHits(), _healing["threshold"]) + "HP")
while (true) {
while (!Player.Dead() && (Player.Hits() < (getPercentValue(Player.MaxHits(), _healing["threshold"])) || Player.Poisoned())) {
Orion.Say("[bandself");
Orion.Wait(200);
if (Orion.BuffExists(_buffs["healing"]) && Orion.BuffTimeRemaining(_buffs["healing"])) {
Orion.AddDisplayTimer("healing",
Orion.BuffTimeRemaining(_buffs["healing"]),
"custom",
"LineBar",
"Healing...",
_healing["statusBar"]["x"],
_healing["statusBar"]["y"]
);
Orion.DisplayTimerSetIcon("healing", "Left", "0x0E21");
Orion.DisplayTimerSetSize("healing", 100, 30);
while (Orion.BuffExists(_buffs["healing"])) {
Orion.Wait(100);
}
}
if (Orion.Count('0x0E21') < 80) {
charPrint('[' + Orion.Count('0x0E21') + '] bandages left ! ');
}
}
Orion.Wait(500);
}
}
function CastBushido() {
print("Started, casting spells:");
var spells = [];
for (var i = 0; i < arguments.length; i++) {
spells.push(arguments[i]);
print(">> " + arguments[i]);
}
while (true) {
spells.forEach(function (spell) {
if (!Player.Dead() && Player.Mana() > 5 && !Orion.SpellStatus(spell)) {
Orion.Cast(spell);
Orion.Wait(500);
}
});
Orion.Wait(100);
}
}
function CastChivalry() {
spells = {
"Consecrate Weapon": 0x75f6,
}
print("Started, casting spells:");
Object.keys(spells).forEach(function (key) {
print(">>> " + key + ", buff -> "+ spells[key]);
});
while (true) {
Orion.GetStatus(Player.Serial());
if (Player.Stam() < 50 && Player.Mana() > 10 && !Orion.BuffExists(0x754d)) {
print("Regenerating stamina");
Orion.Cast("Divine Fury");
Orion.Wait(10000)
}
Object.keys(spells).forEach(function (key) {
if (!Player.Dead() && Player.Mana() > 10 && !Orion.BuffExists(spells[key])) {
Orion.Cast(key);
Orion.Wait(10000);
}
});
Orion.Wait(100);
}
}
function getWeaponInfo(serial) {
var exp = 0;
var lvl = 0;
var object = Orion.FindObject(serial);
if (object != null) {
var properties = object.Properties();
var matchesExp = /Experience: (\d+)/.exec(properties);
var matcheslvl = /Level: (\d+)/.exec(properties);
if (matchesExp && matchesExp.length > 0)
var exp = parseInt(matchesExp[1]);
if (matcheslvl && matcheslvl.length > 0)
var lvl = parseInt(matcheslvl[1]);
return { "lvl": lvl, "exp": exp };
}
}
function WeaponLevelingStats() {
var weapon = "0x402AE1A5";
var started = new Date().getTime();
var totalExp = 0;
while (true) {
var startExp = getWeaponInfo(weapon)['exp'];
if (Orion.WaitJournal("Your weapon", Orion.Now(), Orion.Now() + 20000)) {
Orion.Wait(500);
var currentExp = getWeaponInfo(weapon)['exp'];
var currentLvl = getWeaponInfo(weapon)['lvl'];
var toNextLvl = 100 * Math.pow(currentLvl + 1, 2) - 100;
var totalExp = totalExp + (currentExp - startExp);
var minutes = ((new Date().getTime() - started) / 1000) / 60;
var expPerMinute = (totalExp / minutes).toFixed(2);
Orion.Print('0x0035', "Weapon exp : " + currentExp + "/" + toNextLvl + " (+" + (currentExp - startExp) + ") | "+ totalExp);
Orion.Print('0x0035', "Exp@minute : " + expPerMinute);
}
}
}