-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathraw-svo.setup.lua
1680 lines (1431 loc) · 52.3 KB
/
raw-svo.setup.lua
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-- Svof (c) 2011-2015 by Vadim Peretokin
-- Svof is licensed under a
-- Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
-- You should have received a copy of the license along with this
-- work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
version = "$(version)"
#if DEBUG_actions then
if Logger then Logger:LogSection("svof", {"timestamp", split = 5000, "keepOpen"}) end
#end
local luanotify = {}
luanotify.signal = require("notify.signal")
local lfs = require "lfs"
local debug = require "debug"
openURL = openURL or openUrl
-- !!
local pl = {}
pl.pretty = require "pl.pretty"
pl.config = require "pl.config"
pl.dir = require "pl.dir"
pl.string = require "pl.stringx"
pl.OrderedMap = require "pl.OrderedMap"
pl.tablex = require "pl.tablex"
local phpTable
phpTable = function (...) -- abuse to: http://richard.warburton.it
local newTable,keys,values={},{},{}
newTable.pairs=function(self) -- pairs iterator
local count=0
return function()
count=count+1
return keys[count],values[keys[count]]
end
end
setmetatable(newTable,{
__newindex=function(self,key,value)
if not self[key] then table.insert(keys,key)
elseif value==nil then -- Handle item delete
local count=1
while keys[count]~=key do count = count + 1 end
table.remove(keys,count)
end
values[key]=value -- replace/create
end,
__index=function(self,key) return values[key] end
})
local arg = {...}
for x=1,#arg do
for k,v in pairs(arg[x]) do newTable[k]=v end
end
return newTable
end
function ripairs(t)
local function ripairs_it(t,i)
i=i-1
local v=t[i]
if v==nil then return v end
return i,v
end
return ripairs_it, t, #t+1
end
local function deepcopy(object)
local lookup_table = {}
local function _copy(object)
if type(object) ~= "table" then
return object
elseif lookup_table[object] then
return lookup_table[object]
end
local new_table = {}
lookup_table[object] = new_table
for index, value in pairs(object) do
new_table[_copy(index)] = _copy(value)
end
return setmetatable(new_table, getmetatable(object))
end
return _copy(object)
end
local affs = {}
local balanceless = {}
local cp = {}
local defences = {}
local lifevision = {}
local signals = {}
local sps = {}
local sys = {}
conf = {}
config = {}
defc = {} -- current defences
defs = {}
dragonheal = {} -- stores dragonheal curing strats
lifep = {}
lifevision.l = pl.OrderedMap()
paragraph_length = 0
restore = {}
shrugging = {} -- stores shrugging curing strats
sp = {} -- parry
sp_config = {}
stats = {}
tree = {}
rage = {}
fitness = {}
valid = {}
watch = {}
gaffl = {}
gdefc = {}
local actions, sk, vm, cn, cnrl = false, {}, {}, {}, {}
reset = {}
prio = {}
local affmt = {
__tostring = function (self)
local result = {}
for i,k in pairs(self) do
if k.p.count then
result[#result+1] = i .. ": " ..getStopWatchTime(k.sw).."s (" .. k.p.count .. ")"
else
result[#result+1] = i .. ": " ..getStopWatchTime(k.sw).."s"
end
end
return table.concat(result, ", ")
end
}
setmetatable(affs, affmt)
affl = affl or {}
serverignore = {}
ignore = {}
-- has to be here, before the first dict reference in code, so it counts it as a local and uses this one properly
local dict
local oldecho = conf.commandecho
signals.aeony = luanotify.signal.new()
signals.sync = luanotify.signal.new()
signals.dragonform = luanotify.signal.new()
local haddragonform = false
signals.dragonform:add_post_emit(function()
if defc.dragonform and not haddragonform then
raiseEvent"svo got dragonform"
haddragonform = true
elseif not defc.dragonform and haddragonform then
raiseEvent"svo lost dragonform"
haddragonform = false
end
end)
signals.canoutr = luanotify.signal.new()
signals.canoutr:connect(function()
if (affs.webbed or affs.bound or affs.transfixed or affs.roped or affs.impale or ((affs.crippledleftarm or affs.mangledleftarm or affs.mutilatedleftarm) and (affs.crippledrightarm or affs.mangledrightarm or affs.mutilatedrightarm))) then
sys.canoutr = false
me.canoutr = false
else
sys.canoutr = true
me.canoutr = true
end
end)
signals.removed_from_rift = luanotify.signal.new()
signals.moved = luanotify.signal.new()
signals.systemstart = luanotify.signal.new()
signals.systemstart:connect(function() signals.canoutr:emit() end) -- setup the variables
#if DEBUG then
signals.systemstart:connect(function ()
--~ profiler = newProfiler()
--~ profiler:start()
end)
#end
signals.quit = luanotify.signal.new()
signals.connected = luanotify.signal.new()
#if DEBUG then
signals.quit:connect(function ()
if Logger then Logger:CloseLog("svo") end
end)
#end
signals.quit:add_pre_emit(function () signals.saveconfig:emit() end)
signals.quit:add_pre_emit(function () raiseEvent "svo quit" end)
signals.systemend = luanotify.signal.new()
signals.donedefup = luanotify.signal.new()
-- gmcp ones
signals.gmcpcharname = luanotify.signal.new()
signals.gmcpcharname:connect(function ()
signals.enablegmcp:emit()
end)
signals.gmcproominfo = luanotify.signal.new()
signals.gmcpcharstatus = luanotify.signal.new()
signals.gmcpcharitemslist = luanotify.signal.new()
signals.gmcpcharitemslist:connect(function()
if not gmcp.Char.Items.List.location then debugf("(GMCP problem) location field is missing from Achaea's response.") return end
if gmcp.Char.Items.List.location ~= "inv" then return end
me.inventory = deepcopy(gmcp.Char.Items.List.items)
end)
signals.gmcpcharitemsadd = luanotify.signal.new()
signals.gmcpcharitemsadd:connect(function()
if not gmcp.Char.Items.Add.location then debugf("(GMCP problem) location field is missing from Achaea's response.") return end
if gmcp.Char.Items.Add.location ~= "inv" then return end
me.inventory[#me.inventory + 1] = deepcopy(gmcp.Char.Items.Add.item)
end)
signals.gmcpcharskillsinfo = luanotify.signal.new()
signals.gmcpcharskillslist = luanotify.signal.new()
signals.gmcpcharitemsupdate = luanotify.signal.new()
signals.gmcpcharitemsupdate:connect(function()
if not gmcp.Char.Items.Update.location then debugf("(GMCP problem) location field is missing from Achaea's response.") return end
if gmcp.Char.Items.Update.location ~= "inv" then return end
local update = gmcp.Char.Items.Update.item
for i, item in ipairs(me.inventory) do
if item.id == update.id then
me.inventory[i] = deepcopy(gmcp.Char.Items.Update.item)
break
end
end
end)
signals.gmcpcharitemsremove = luanotify.signal.new()
signals.gmcpcharitemsremove:connect(function()
if not gmcp.Char.Items.Remove.location then debugf("(GMCP problem) location field is missing from Achaea's response.") return end
if gmcp.Char.Items.Remove.location ~= "inv" then return end
local remove = gmcp.Char.Items.Remove.item
for i, item in ipairs(me.inventory) do
if item.id == remove.id then
table.remove(me.inventory, i)
break
end
end
end)
signals.gmcpcharvitals = luanotify.signal.new()
signals.gmcpcharvitals:connect(function()
if gmcp.Char.Vitals.charstats then
for index, val in ipairs(gmcp.Char.Vitals.charstats) do
local rage = val:match("^Rage: (%d+)$")
if rage then
stats.battlerage = tonumber(rage)
else
local bleed = val:match("^Bleed: (%d+)$")
if bleed then
if bleed == "0" then
removeaff("bleeding")
else
dict.bleeding.aff.oncompleted(tonumber(bleed))
end
end
end
end
end
if not stats.battlerage then
stats.battlerage = 0
end
end)
#if skills.groves then
signals.gmcpcharvitals:connect(function()
if gmcp.Char.Vitals.charstats then
for index, val in ipairs(gmcp.Char.Vitals.charstats) do
if sunlight then
local sunlight = val:match("^Sunlight: (%d+)$")
stats.sunlight = tonumber(sunlight)
break
end
end
end
if not stats.sunlight then
stats.sunlight = 0
end
end)
#end
#if skills.metamorphosis then
signals.gmcpcharvitals:connect(function()
if gmcp.Char.Vitals.charstats then
for index, val in ipairs(gmcp.Char.Vitals.charstats) do
local morph = val:match("^Morph: (%w+)$")
if morph then
morph = morph:lower()
me.morph = morph
if not defc[morph] then
sk.clearmorphs()
if morph ~= "none" then
defences.got(morph)
end
end
break
end
end
end
if not me.morph then
me.morph = ""
end
end)
#end
#if class == "monk" then
signals.gmcpcharvitals:connect(function()
if gmcp.Char.Vitals.charstats then
for index, val in ipairs(gmcp.Char.Vitals.charstats) do
local stance = val:match("^Stance: (%w+)$")
local form = val:match("^Form: (%w+)$")
if stance then
me.path = "tekura"
me.form = nil
me.stance = stance:lower()
sk.ignored_defences['tekura'].status = false
sk.ignored_defences['shikudo'].status = true
break
elseif form then
me.path = "shikudo"
me.form = form:lower()
me.stance = nil
sk.ignored_defences['tekura'].status = true
sk.ignored_defences['shikudo'].status = false
break
end
end
end
if not me.path then
me.path = "tekura"
end
end)
#end
signals.gmcpiretimelist = luanotify.signal.new()
signals.gmcpiretimelist:connect(function()
me.gametime = deepcopy(gmcp.IRE.Time.List)
end)
signals.gmcpiretimeupdate = luanotify.signal.new()
signals.gmcpiretimeupdate:connect(function()
me.gametime = me.gametime or {}
for k, v in pairs(gmcp.IRE.Time.Update) do
me.gametime[k] = v
end
end)
signals.gmcpcharafflictionslist = luanotify.signal.new()
signals.gmcpcharafflictionsremove = luanotify.signal.new()
signals.gmcpcharafflictionsadd = luanotify.signal.new()
signals.gmcpchardefenceslist = luanotify.signal.new()
signals.gmcpchardefencesremove = luanotify.signal.new()
signals.gmcpchardefencesadd = luanotify.signal.new()
signals.gmcpcharafflictionsadd:connect(function()
local thisaff = gmcp.Char.Afflictions.Add.name
if thisaff:sub(-4) == " (1)" then thisaff = thisaff:sub(1, -5) end
gaffl[thisaff] = true
if conf.gmcpaffechoes then echof("Gained aff %s", thisaff) end
if dict.sstosvoa[thisaff] then
addaff(dict.sstosvoa[thisaff])
end
end)
signals.gmcpcharafflictionsremove:connect(function()
local thisaff = gmcp.Char.Afflictions.Remove[1]
gaffl[thisaff] = nil
if conf.gmcpdefechoes then echof("Cured aff %s", thisaff) end
if dict.sstosvoa[thisaff] then
removeaff(dict.sstosvoa[thisaff])
end
end)
signals.gmcpcharafflictionslist:connect(function()
gaffl = {}
local preaffl = {}
for key, val in ipairs(affl) do preaffl[val] = true end
for index, val in ipairs(gmcp.Char.Afflictions.List) do
local thisaff = val.name
if thisaff:sub(-4) == " (1)" then thisaff = thisaff:sub(1, -5) end
gaffl[thisaff] = true
if preaffl[thisaff] then
preaffl[thisaff] = false
elseif dict.sstosvoa[thisaff] then
addaff(dict.sstosvoa[thisaff])
end
end
for key, val in pairs(preaffl) do
if val and dict.svotossa[thisaff] then removeaff(key) end
end
end)
signals.gmcpchardefencesadd:connect(function()
thisdef = gmcp.Char.Defences.Add.name
gdefc[thisdef] = true
if conf.gmcpdefechoes then echof("Gained def "..thisdef) end
if dict.sstosvod[thisdef] then
if type(defs["got_"..dict.sstosvod[thisdef]]) == "function" then
defs["got_"..dict.sstosvod[thisdef]](true)
else
echoLink("(e!)", [[echo("The problem was: got_ function was ]]..type(defs["got_"..dict.sstosvod[thisdef]])..[[ for defence ]]..dict.sstosvod[thisdef]..[[ (gmcp:]]..thisdef..[[)")]], 'Oy - there was a problem. Click on this link and submit a bug report with what it says along with a copy/paste of what you saw.')
end
end
end)
signals.gmcpchardefencesremove:connect(function()
thisdef = gmcp.Char.Defences.Remove[1]
gdefc[thisdef] = nil
if conf.gmcpdefechoes then echof("Lost def "..thisdef) end
if dict.sstosvod[thisdef] then
if type(defs["lost_"..dict.sstosvod[thisdef]]) == "function" then
defs["lost_"..dict.sstosvod[thisdef]]()
else
echoLink("(e!)", [[echo("The problem was: lost_ function was ]]..type(defs["lost_"..dict.sstosvod[thisdef]])..[[ for defence ]]..dict.sstosvod[thisdef]..[[ (gmcp:]]..thisdef..[[)")]], 'Oy - there was a problem. Click on this link and submit a bug report with what it says along with a copy/paste of what you saw.')
end
end
end)
signals.gmcpchardefenceslist:connect(function()
gdefc = {}
local predefs = deepcopy(defc)
for index, val in ipairs(gmcp.Char.Defences.List) do
thisdef = val.name
gdefc[thisdef] = true
if dict.sstosvod[thisdef] then
if predefs[dict.sstosvod[thisdef]] then
predefs[dict.sstosvod[thisdef]] = false
elseif type(defs["got_"..dict.sstosvod[thisdef]]) == "function" then
defs["got_"..dict.sstosvod[thisdef]](true)
else
echoLink("(e!)", [[echo("The problem was: got_ function was ]]..type(defs["got_"..dict.sstosvod[thisdef]])..[[ for defence ]]..dict.sstosvod[thisdef]..[[ (gmcp:]]..thisdef..[[)")]], 'Oy - there was a problem. Click on this link and submit a bug report with what it says along with a copy/paste of what you saw.')
end
end
end
for defname, val in pairs(predefs) do
if val == true and dict.sstosvod[defname] then
if type(defs["lost_"..dict.sstosvod[defname]]) == "function" then
defs["lost_"..dict.sstosvod[defname]]()
else
echoLink("(e!)", [[echo("The problem was: lost_ function was ]]..type(defs["lost_"..dict.sstosvod[defname]])..[[ for defence ]]..dict.sstosvod[defname]..[[ (gmcp:]]..defname..[[)")]], 'Oy - there was a problem. Click on this link and submit a bug report with what it says along with a copy/paste of what you saw.')
end
end
end
end)
-- make a 'signals bank' that remembers all gmcp events that happend before the prompt. reset on prompt. check it for stuff when necessary.
-- have the herb out signal be remembers on it's own & verified by the syste
do
local oldnum, oldarea
signals.gmcproominfo:connect(function (...)
if me then
if table.contains(gmcp.Room.Info.details, "underwater") then
me.is_underwater = true
else
me.is_underwater = false
end
end
if oldnum ~= gmcp.Room.Info.num then
signals.newroom:emit(_G.gmcp.Room.Info.name)
oldnum = gmcp.Room.Info.num
end
signals.anyroom:emit(_G.gmcp.Room.Info.name)
if oldarea ~= gmcp.Room.Info.area then
signals.newarea:emit(_G.gmcp.Room.Info.area)
oldarea = gmcp.Room.Info.area
end
end)
end
-- atcp ones
signals.charname = luanotify.signal.new()
signals.roombrief = luanotify.signal.new()
do
local oldnum
signals.roombrief:connect(function (...)
if oldnum ~= atcp.RoomNum then
signals.newroom:emit(({...})[1])
oldnum = atcp.RoomNum
end
signals.anyroom:emit(({...})[1])
end)
end
-- general ones
signals.relogin = luanotify.signal.new()
signals.enablegmcp = luanotify.signal.new()
signals.enablegmcp:add_post_emit(function ()
logging_in = false
if not sys.enabledgmcp then
sys.enabledgmcp = true
else
signals.relogin:emit()
echof("Welcome back!")
-- defs.quietswitch("basic")
end
-- app("off", true) -- this triggers a dict() run too early before login
if dont_unpause_login then dont_unpause_login = nil
else conf.paused = false end
innews = false
end)
tempBeginOfLineTrigger("Rapture Runtime Environment", [[svo.logging_in = true]])
signals.newroom = luanotify.signal.new()
signals.newarea = luanotify.signal.new()
signals.anyroom = luanotify.signal.new()
signals.changed_maxhealth = luanotify.signal.new()
signals.changed_maxhealth:connect(function (old, new) -- can't use add_post_emit, as that doesn't pass arguments down
if not string.find(debug.traceback(), "Alias", 1, true) then
if not (old and new) or (old and old == 1) then
echof("Your max health changed to %dh.", stats.maxhealth)
elseif old > new then
echof("Your max health decreased by %dh/%d%% to %d.", (old-new), 100-math.floor((100/old)*new), new)
else
echof("Your max health increased by %dh/%d%% to %d.", (new-old), (math.floor((100/old)*new)-100), new)
-- track stain
sk.gotmaxhealth = true
prompttrigger("check stain expiring", function()
if paragraph_length == 0 and sk.gotmaxhealth and sk.gotmaxmana and affs.stain then
removeaff("stain")
echof("I think stain faded.")
end
sk.gotmaxhealth, sk.gotmaxmana = nil, nil
end)
end
end
end)
signals.changed_maxmana = luanotify.signal.new()
signals.changed_maxmana:connect(function (old, new)
if not string.find(debug.traceback(), "Alias", 1, true) then
if not (old and new) or (old and old == 1) then
echof("Your max mana changed to %dm.", stats.maxmana)
elseif old > new then
echof("Your max mana decreased by %dm/%d%% to %d.", (old-new), 100-math.floor((100/old)*new), new)
else
echof("Your max mana increased by %dm/%d%% to %d.", (new-old), (math.floor((100/old)*new)-100), new)
sk.gotmaxmana = true
prompttrigger("check stain expiring", function()
if paragraph_length == 0 and sk.gotmaxhealth and sk.gotmaxmana and affs.stain then
removeaff("stain")
echof("I think stain faded.")
end
sk.gotmaxhealth, sk.gotmaxmana = nil, nil
end)
end
end
end)
signals.before_prompt_processing = luanotify.signal.new()
signals.after_prompt_processing = luanotify.signal.new()
signals.after_lifevision_processing = luanotify.signal.new()
signals.curedwith_focus = luanotify.signal.new()
signals.curemethodchanged = luanotify.signal.new()
signals.limbhit = luanotify.signal.new()
signals.loadconfig = luanotify.signal.new()
signals.orgchanged = luanotify.signal.new()
signals.saveconfig = luanotify.signal.new()
signals.sysdatasendrequest = luanotify.signal.new()
#if skills.healing then
signals.healingskillchanged = luanotify.signal.new()
#end
#if skills.metamorphosis then
signals.morphskillchanged = luanotify.signal.new()
#end
signals.saveconfig:add_post_emit(function ()
echo"\n"
echof("Saved system settings.")
end)
signals.loadedconfig = luanotify.signal.new()
signals.svogotaff = luanotify.signal.new()
signals.svolostaff = luanotify.signal.new()
signals.sysexitevent = luanotify.signal.new()
signals["mmapper updated pdb"] = luanotify.signal.new()
signals["svo config changed"] = luanotify.signal.new()
signals["svo defup changed"] = luanotify.signal.new()
signals["svo got balance"] = luanotify.signal.new()
signals["svo ignore changed"] = luanotify.signal.new()
signals["svo keepup changed"] = luanotify.signal.new()
signals["svo lost balance"] = luanotify.signal.new()
signals["svo prio changed"] = luanotify.signal.new()
signals["svo serverignore changed"] = luanotify.signal.new()
signals["svo switched defence mode"] = luanotify.signal.new()
signals["svo system loaded"] = luanotify.signal.new()
signals["svo done defup"] = luanotify.signal.new()
conf.siphealth = 80
conf.sipmana = 70
conf.mosshealth = 60
conf.mossmana = 60
conf.assumestats = 15
conf.ai_resetfocusbal = 5
conf.ai_resetsipbal = 7 -- was 5 before, but started overrunning
conf.ai_resetherbbal = 2.5 -- normally at 1.6
conf.ai_resetsalvebal = 5
conf.ai_resetmossbal = 10 -- resets at 6
#if skills.healing then
conf.ai_resethealingbal = 7 -- resets at 2s for healing allies, near 4s for healing yourself, and offensive skills as inbetween
#end
conf.ai_resetpurgativebal = 10 -- it's 7s for voyria
conf.ai_resetdragonhealbal = 20 -- 20s for dragonheal
conf.ai_resetsmokebal = 2 -- ~1.5s for smoking bal
conf.ai_minherbbal = 1.0
conf.ai_restoreckless = 0.4
conf.ai_minrestorecure = 3.5
conf.tekura_delay = 0.050
conf.classattacksamount = 3
conf.classattackswithin = 15
conf.enableclassesfor = 2
conf.singlepromptsize = 11
conf.gagotherbreath = true
conf.gagbreath = true
conf.burrowpause = true
conf.changestype = "shortpercent"
conf.paused = false
conf.lag = 0
sys.wait = 0.7 -- for lag
conf.aillusion = true -- on by deafult, disable it if necessary
conf.keepup = true
conf.burstmode = "empty"
conf.slowcurecolour = "blue"
conf.hinderpausecolour = "orange"
conf.sacdelay = 0.5 -- delay after which the systems curing should resume in sync mode
conf.bleedamount = 60
conf.manableedamount = 60
conf.corruptedhealthmin = 70
conf.manause = 35
conf.fluiddelay = 0.3
conf.smallbleedremove = 8
conf.eventaffs = true
conf.autoarena = true
-- have skills?
conf.commandecho = true
conf.blockcommands = true
conf.commandechotype = "fancy"
conf.warningtype = "right"
conf.autoreject = "white"
conf.doubledo = false
conf.ridingskill = "mount"
conf.ridingsteed = "pony"
conf.screenwidth = 100
conf.refillat = 1
conf.waitherbai = true
conf.noeqtimeout = 5
conf.autoslick = true
conf.showbaltimes = true
conf.showafftimes = true
conf.steedfollow = true
conf.autoclasses = true
conf.ccto = "pt"
conf.repeatcmd = 0
#if skills.healing then
conf.usehealing = "partial"
#end
#if skills.kaido then
conf.transmute = "supplement"
conf.transmuteamount = 70
#end
#if skills.devotion then
conf.bloodswornoff = 30
#end
conf.gagclot = true
conf.gagrelight = false
conf.relight = true
conf.passive_eqloss = 10
conf.highlightparryfg = "white"
conf.highlightparrybg = "blue"
conf.autotsc = true
conf.ignoresinglebites = false
conf.medprone = false
conf.unmed = false
conf.pagelength = 20
conf.treebalance = 0
conf.healthaffsabove = 70
conf.batch = true
conf.curemethod = "conconly"
signals.systemstart:add_post_emit(function()
if not conf.curemethod or conf.curemethod == "auto" then
conf.curemethod = "conconly"
end
end)
conf.ninkharsag = true
sys.sync = false
sys.deffing = false
sys.balanceid = 0
sys.balancetick = 1
sys.lagcount, sys.lagcountmax = 0, 3
sys.actiontimeout = 3
sys.actiontimeoutid = false
sys.manause = 0
sys.sipmana, sys.siphealth, sys.mosshealth, sys.mossmana = 0, 0, 0, 0
sys.transmuteamount = 0
sys.sp_satisfied, sys.blockparry = false, false
sys.canoutr = true
-- the in-game custom prompt needs to show the game target and game target hp, since that isn't available in GMCP at the moment, as well as any class-specific balances and values
#if not skills.weaponmastery then
sys.ingamecustomprompt ="CONFIG PROMPT CUSTOM *hh, *mm, *ee, *ww *t*T *b*d*c-*r-s*s-"
#else
-- account for ferocity
sys.ingamecustomprompt ="CONFIG PROMPT CUSTOM *hh, *mm, *ee, *ww *t*T *b*d*c-*r-k*k-s*s-"
#end
-- used in lyre actions to prevent doubledo from activating - since that'd destroy the lyre right away
sys.sendonceonly = false
-- a map that has possible commands linked to dict.action.balance entries
sys.input_to_actions = {}
-- a map that stores dict.action.balance.name
sys.last_used = {}
$(
local paths = {}; paths.oldpath = package.path; package.path = package.path..";./?.lua;./bin/?.lua;"; local pretty = require "pl.pretty"; package.path = paths.oldpath
_put("sys.downloadurl = ".. pretty.write(url))
)
---
danaeusaffs = {"agoraphobia", "claustrophobia", "dizziness", "epilepsy", "hypersomnia", "vertigo"}
nemesisaffs = {"agoraphobia", "recklessness", "confusion", "masochism", "loneliness"}
scragaffs = {"clumsiness", "healthleech", "lethargy", "sensitivity", "haemophilia", "darkshade"}
---
stats.nextlevel,
stats.currenthealth, stats.maxhealth,
stats.currentmana, stats.maxmana,
stats.currentendurance, stats.maxendurance,
stats.currentwillpower, stats.maxwillpower = 1,1,1,1,1,1,1,1,1
#if skills.kaido then
stats.kai = 0
#end
---
me = {}
me.skills = {}
me.wielded = {}
me.oldhealth = 0
$(
local paths = {}; paths.oldpath = package.path; package.path = package.path..";./?.lua;./bin/?.lua;"; local pretty = require "pl.pretty"; local stringx = require "pl.stringx"; local tablex = require "pl.tablex"; package.path = paths.oldpath
_put(string.format("me.class = \"%s\"\n", type(class) == "string" and stringx.title(class) or table.concat(tablex.imap(stringx.title, class), ", ")))
_put("me.skills = ".. pretty.write(skills))
)
me.doqueue = {repeating = false}
me.dofreequeue = {}
me.dopaused = false
me.lustlist = {} -- list if names not to add lovers aff for
me.hoistlist = {} -- list if names not to add hoisted aff for
me.lasthitlimb = "head" -- last hit limb
me.disableddragonhealfunc = {}
me.disabledrestorefunc = {}
#if skills.venom then
me.disabledshruggingfunc = {}
#end
me.disabledtreefunc = {}
me.disabledragefunc = {}
me.disabledfitnessfunc = {}
me.unparryables = {}
me.focusedknights = {}
me.locks = {}
me.curelist = {
ash = "ash",
bayberry = "bayberry",
bellwort = "bellwort",
bloodroot = "bloodroot",
caloric = "caloric",
cohosh = "cohosh",
echinacea = "echinacea",
elm = "elm",
epidermal = "epidermal",
frost = "frost",
ginger = "ginger",
ginseng = "ginseng",
goldenseal = "goldenseal",
hawthorn = "hawthorn",
health = "health",
immunity = "immunity",
irid = "irid",
kelp = "kelp",
kola = "kola",
levitation = "levitation",
lobelia = "lobelia",
mana = "mana",
mass = "mass",
mending = "mending",
myrrh = "myrrh",
pear = "pear",
restoration = "restoration",
sileris = "sileris",
skullcap = "skullcap",
speed = "speed",
valerian = "valerian",
venom = "venom",
}
me.cadmusaffs = me.cadmusaffs or {
["agoraphobia"] = false,
["anorexia"] = true,
["claustrophobia"] = false,
["confusion"] = false,
["dizziness"] = false,
["epilepsy"] = false,
["fear"] = false,
["generosity"] = false,
["loneliness"] = false,
["masochism"] = false,
["pacifism"] = false,
["recklessness"] = true,
["shyness"] = false,
["stupidity"] = true,
["unknownmental"] = false,
["vertigo"] = false,
["weakness"] = false,
}
me.inventory = {}
me.getitem = function(name)
for _, thing in ipairs(me.inventory) do
if thing.name == name then
return thing
end
end
end
---
#if not skills.shindo then
disableTrigger("Shindo defences")
#else
enableTrigger("Shindo defences")
#end
#if not skills.kaido then
disableTrigger("Kaido defences")
#else
enableTrigger("Kaido defences")
#end
#if not skills.tekura then
disableTrigger("Tekura balances")
#else
enableTrigger("Tekura balances")
#end
#if class == "druid" then
enableTrigger("Hydra balance")
#else
disableTrigger("Hydra balance")
#end
#if skills.voicecraft then
enableTrigger("Voice balance")
#else
disableTrigger("Voice balance")
#end
#if skills.chivalry or skills.shindo or skills.kaido or skills.metamorphosis then
enableTrigger("Fitness balance")
#else
disableTrigger("Fitness balance")
#end
#if skills.chivalry then
enableTrigger("Rage balance")
#else
disableTrigger("Rage balance")
#end
#if skills.weaponmastery then
enableTrigger("Two-hander recover footing")
#else
disableTrigger("Two-hander recover footing")
#end
#if skills.domination then
enableTrigger("Domination entities balance")
#else
disableTrigger("Domination entities balance")
#end
#if skills.venom then
enableTrigger("Shrugging balance")
#else
disableTrigger("Shrugging balance")
#end
#if skills.healing or skills.elementalism then
enableTrigger("Healing + Elementalism channels")
#else
disableTrigger("Healing + Elementalism channels")
#end
#if skills.elementalism then
enableAlias("Elementalism aliases")
#else
disableAlias("Elementalism aliases")
#end
#if skills.spirituality then
enableTrigger("Spirituality defences")
enableAlias("Spirituality aliases")
#else
disableTrigger("Spirituality defences")
disableAlias("Spirituality aliases")
#end
#if skills.propagation then
enableTrigger("Propagation defences")
#else
disableTrigger("Propagation defences")
#end
#if skills.necromancy then
enableTrigger("Necromancy defences")
#else
disableTrigger("Necromancy defences")
#end
#if not skills.occultism then
disableTrigger("Occultism defences")
#else
enableTrigger("Occultism defences")
#end
#if not skills.alchemy then
disableTrigger("Alchemy defences")
#else
enableTrigger("Alchemy defences")
#end
#if not skills.groves then
disableTrigger("Groves defences")
#else