forked from Tald0r/OrionUO-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpider-Webs-Destroyer.js
75 lines (71 loc) · 2.39 KB
/
Spider-Webs-Destroyer.js
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
////////////////////////////////////////////////////////////////////////////////
// ~ Spider Webs Destroyer ~ //
// - Taldor / Quin - //
////////////////////////////////////////////////////////////////////////////////
//
// SpiderWebsDestroyer:
// Vyhleda a znici postupne vsechny pavuciny v dosahu (1 policko) kolem charakteru
//
// SpiderWebsDestroyer_Toggle:
// to stejne ale s moznosti ON / OFF switche, tzn. neustaly beh na pozadi
//
// Pouziti:
// Hotkey -> Run script :
// SpiderWebsDestroyer()
// SpiderWebsDestroyer_Toggle() <- !!! NEZASKRTAVAT "Run one script" !!!
//
////////////////////////////////////////////////////////////////////////////////
function SpiderWebsDestroyer() {
var webs = FindSpiderWebs(null);
if (webs == null) {
Orion.ResetIgnoreList();
Orion.IgnoreReset();
Orion.Print('-1', 'Zadny pavuciny v okoli nejsou!');
}
while (webs) {
Orion.AddObject('SpiderWeb', webs.Serial());
Orion.CharPrint(webs.Serial(), '-1', '>>> NICIM <<<');
Orion.Wait(250);
Orion.UseObject('SpiderWeb');
Orion.Wait(250);
webs = FindSpiderWebs(null);
}
}
function SpiderWebsDestroyer_Watcher(_private) {
Orion.CharPrint('self', '0x44', '- SWD Watcher ON -');
Orion.SetGlobal('SWD_loop', 1);
while (!Player.Dead()) {
var webs = FindSpiderWebs(null);
if (webs == null) {
Orion.ResetIgnoreList();
Orion.IgnoreReset();
//Orion.Print('-1', 'Zadny pavuciny v okoli nejsou!');
}
while (webs) {
Orion.AddObject('SpiderWeb', webs.Serial());
Orion.CharPrint(webs.Serial(), '-1', '>>> NICIM <<<');
Orion.Wait(250);
Orion.UseObject('SpiderWeb');
Orion.Wait(250);
webs = FindSpiderWebs(null);
}
Orion.Wait(1000);
}
}
function SpiderWebsDestroyer_Toggle() {
if (Orion.GetGlobal('SWD_loop') == 1) {
//Orion.Print('Target not dead yet,restarting loop');
Orion.Terminate('SpiderWebsDestroyer_Watcher');
Orion.CharPrint('self', '0x22', '- SWD Watcher OFF -');
Orion.SetGlobal('SWD_loop', 0);
} else {
Orion.Exec('SpiderWebsDestroyer_Watcher');
}
}
function FindSpiderWebs(dummy) {
var spiderWebs = Orion.FindType('0x0EE1|0x0EE2|0x0EE3|0x0EE4|0x0EE5|0x0EE6|0x0EE7|0x0EE8', '-1', ground, 'fast', '1');
if (spiderWebs.length) {
return Orion.FindObject(spiderWebs[0]);
}
return null;
}