-
Notifications
You must be signed in to change notification settings - Fork 57
/
SCRIPTS
979 lines (799 loc) · 22.1 KB
/
SCRIPTS
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
#nop -------------------------------------------------------------------------
#nop Learn by example
#nop -------------------------------------------------------------------------
#nop -------------------------------------------------------------------------
#nop Loop through room 1 to 1000 and change the color of rooms with the
#nop static (16) flag to <168>.
#nop -------------------------------------------------------------------------
#loop 1 1000 vnum
{
#map at $vnum
{
#map get roomflags result;
#if {$result & 16}
{
#map set roomcolor <168>
}
}
}
#nop -------------------------------------------------------------------------
#nop Capture system information. #script stores the output as a list,
#nop hence the need to convert it into a normal variable.
#nop -------------------------------------------------------------------------
#script {dir} {pwd}
#var dir $dir[1]
#script {home} {echo $HOME}
#var home $home[1]
#nop -------------------------------------------------------------------------
#nop Automatically reconnect on disconnect.
#nop -------------------------------------------------------------------------
#event {SESSION CONNECTED}
{
#event {SESSION DISCONNECTED}
{
#gts #delay 5 {#session %0 %1 %3}
}
}
#nop -------------------------------------------------------------------------
#nop Execute a random social at random time intervals.
#nop -------------------------------------------------------------------------
#tick {randomsocial}
{
#delay {1d180}
{
#switch {1d4}
{
#case {1} {cheer};
#case {2} {greet all};
#case {3} {smile};
#case {4} {laugh self}
}
}
}
{200}
#nop -------------------------------------------------------------------------
#nop Maintain a friendlist. %i creates a case insensitive regex.
#nop -------------------------------------------------------------------------
#variable {friendlist}
{
{bubba};{pamela};{cookie};{harry potter}
}
#function isfriend
{
#return &friendlist[%i%0];
}
#act {%1 follows you.}
{
#if {@isfriend{%1}}
{
group %1
};
#else
{
unfollow %1
}
}
#alias {addfriend}
{
#format name %l {%0};
#var friendlist[$name] {};
#showme $name has been added to your friendlist.
}
#alias {delfriend}
{
#format name %l {%0};
#if {@isfriend{$name}}
{
#unvar friendlist[$name];
#showme $name has been deleted from your friendlist.
};
#else
{
#showme $name is not on your friendlist.
}
}
#nop -------------------------------------------------------------------------
#nop Append a goto to your current room when saving a map. You can use
#nop #map return instead.
#nop -------------------------------------------------------------------------
#alias {savemap}
{
#map write %0;
#map get roomvnum room;
#system echo '#map goto $room' >> %0
}
#nop -------------------------------------------------------------------------
#nop Log all text to a file with a timestamp with decisecond precision.
#nop -------------------------------------------------------------------------
#function {timestamp}
{
#format utime {%U};
#format result {%t.%m} {%Y-%m-%d %H:%M:%S} {$utime % 1000000 / 100000}
}
#event {RECEIVED LINE}
{
#line log mylog.txt {<178>@timestamp{} \};
#line log mylog.txt
}
#nop -------------------------------------------------------------------------
#nop Old school tick support.
#nop -------------------------------------------------------------------------
#tick {oldtick}
{
#delay 50 #showme #10 SECONDS TO TICK!!;
#showme #TICK!!!
}
{60}
#alias {ticklist}
{
#info tickers save;
#echo {<128>%+20s %+20s %+20s} {Name} {Interval} {Remaining};
#draw Yellow scroll line 1 1 1 62;
#format utime %U;
#loop 1 &info[TICKERS][] index
{
#math uval $info[TICKERS][+$index][arg3] * 1000000;
#echo {%+20s %+20s %+20m}
{$info[TICKERS][+$index][arg1]}
{$info[TICKERS][+$index][arg3]}
{($uval - ($utime - $info[TICKERS][+$index][arg4]) % $uval) / 1000000.00}
}
}
#nop -------------------------------------------------------------------------
#nop Execute speedwalks with .
#nop -------------------------------------------------------------------------
#alias {.%0}
{
#var cnt {};
#parse {%0} {char}
{
#if {"$char" >= "0" && "$char" <= "9"}
{
#var cnt $cnt$char
};
#elseif {"$cnt" == ""}
{
#send $char
};
#else
{
#$cnt #send $char;
#var cnt {}
}
}
}
#nop -------------------------------------------------------------------------
#nop Targetting script
#nop -------------------------------------------------------------------------
#var targets {}
#alias {target}
{
#if {"%0" == ""}
{
#showme {Current targets: $targets[]}
};
#elseif {&targets[%0]}
{
#unvar targets[%0];
#showme Target '%0' removed.
};
#else
{
#var targets[%0] {};
#showme Target '%0' added.
}
}
#act {%1 arrives}
{
#if {&targets[%1]} {kill %1}
}
#act {%1 is standing here}
{
#if {&targets[%1]} {kill %1}
}
#action {%1 is dead! R.I.P.}
{
#if {&targets[%1]} {target %1}
}
#nop -------------------------------------------------------------------------
#nop Show xterm 256 colors.
#nop -------------------------------------------------------------------------
#var temp {}
#foreach {0;1;2;3;4;5;6;7;8;9;10;11;12;13;14;15} {var1}
{
#showme {$var1 \e[38;5;${var1}m}
}
#foreach {a;b;c;d;e;f} {var1}
{
#foreach {a;b;c;d;e;f} {var2}
{
#foreach {a;b;c;d;e;f} {var3}
{
#var temp {$temp <$var1$var2$var3><<888>$var1$var2$var3>}
};
#showme $temp;
#var temp {}
}
}
#loop 0 23 cnt
{
#format temp {$temp <g%+02s><<888>g%+02s} {$cnt} {$cnt};
}
#showme $temp
#nop -------------------------------------------------------------------------
#nop Draw a health bar.
#nop -------------------------------------------------------------------------
#alias {hpbar}
{
#math {hp_percent}{100 * %1 / %2};
#math {hpbars1} {$hp_percent / 5};
#math {hpbars2} {20 - $hpbars1};
#format {hpbar} {<011>%+${hpbars1}s<099><000>%+${hpbars2}s<099> };
#showme [$hpbar]
}
#alias {test}
{
hpbar 30 100
}
#nop -------------------------------------------------------------------------
#nop Syntax: sleep <seconds to delay> {commands}
#nop
#nop If there is already a pending sleep the delay will be stacked.
#nop -------------------------------------------------------------------------
#var sleeptime 0
#var sleepcurr 0
#alias {sleep %1 %2}
{
#format sleeptime %U;
#if {$sleeptime > $sleepcurr}
{
#math sleepcurr $sleeptime + (%1) * 1000000;
#delay {%1} %2;
};
#else
{
#math sleepcurr $sleepcurr + (%1) * 1000000;
#delay {($sleepcurr - $sleeptime) / 1000000.000} %2
}
}
#nop -------------------------------------------------------------------------
#nop This function and substitution will highlight spelling errors as red.
#nop -------------------------------------------------------------------------
#function spellcheck
{
#format result %S %1;
#if {$result == 0}
{
#var result %1
};
#else
{
#var result <118>%1<900>
}
}
#substitute {{\b[a-zA-Z]+\b}} {@spellcheck{%1}}
#nop -------------------------------------------------------------------------
#nop This function and substitution will add a speed reader to the split line
#nop -------------------------------------------------------------------------
#split
#function spellcheck
{
#format result %S %1;
#if {$result == 0}
{
#var result %1
};
#else
{
#var result <118>%1<900>
};
#list speedread ins -1 {$result}
}
#substitute {{\b[a-zA-Z]+\b}} {@spellcheck{%1}}
#tick {speedread}
{
#if {&{speedread[]}}
{
#draw tile -2 1 -2 20 {$speedread[1]};
#list speedread delete 1
}
}
{0.1}
#nop -------------------------------------------------------------------------
#nop This function tests the random number engine
#nop -------------------------------------------------------------------------
#alias random
{
#var random {};
#loop 1 1000 cnt
{
#math tmp 1d1000000000 % 10;
#math random[$tmp] $random[$tmp] + 1
};
#var random
}
#nop -------------------------------------------------------------------------
#nop This macro allows pasting multi-line code fragments on pressing ctrl-v
#nop -------------------------------------------------------------------------
#macro {\cv}
{
#cursor {convert meta} on;
#line oneshot #event {CATCH RECEIVED INPUT}
{
#line sub {esc} #var paste {%0};
#replace paste {\\n\\n} {;};
#replace paste {\\n} {};
#replace paste {\\t} {};
#replace paste {;;} {;};
#1 {$paste}
}
}
#nop -------------------------------------------------------------------------
#nop This macro allows pasting multi-line code fragments on pressing ctrl-v
#nop followed by pressing ctrl-enter
#nop -------------------------------------------------------------------------
#macro {\e[13;5u}
{
#cursor get tmp;
#cursor home;
#cursor set {#line sub esc };
#cursor enter
}
#nop -------------------------------------------------------------------------
#nop This event will cause tintin to always report your screen width as 80
#nop columns
#nop -------------------------------------------------------------------------
#event {CATCH IAC DO NAWS}
{
#screen get rows ROWS;
#format ROWS %a $ROWS;
#send {\xFF\xFB\x1F\xFF\xFA\x1F\x50\x00${ROWS}\x00\xFF\xF0\}
}
#nop -------------------------------------------------------------------------
#nop Remove duplicate lines and add a counter. Does not work in gts because
#nop it uses named delays.
#nop -------------------------------------------------------------------------
#var repeat[str] {}
#var repeat[cnt] 1
#act {~%+}
{
#if {{%0} === {$repeat[str]}}
{
#math repeat[cnt] $repeat[cnt] + 1;
#delay {repeat} {repeat_show} {0}
};
#else
{
repeat_show;
#var repeat[str] {%0}
};
#line gag
}
#alias {repeat_check}
{
#if {$repeat[cnt] <= 1}
{
#line ignore #showme {$repeat[str]}
};
#else
{
#line ignore #showme {($repeat[cnt]) %0}
};
#var repeat[str] {};
#var repeat[cnt] 1
}
#nop -------------------------------------------------------------------------
#nop These macros will allow you to move around with the arrow keys while
#nop holding down the control key. You can move ne by pressing arrow up +
#nop right simultaniously. Move up by pressing arrow up + down simultaniously.
#nop Move down by pressing arrow left + right simultaniously.
#nop -------------------------------------------------------------------------
#macro {\e[1;5A} {#cursor macro preserve;#delay {move} {#cursor macro reset;n} {0.05}}
#macro {\e[1;5C} {#cursor macro preserve;#delay {move} {#cursor macro reset;e} {0.05}}
#macro {\e[1;5B} {#cursor macro preserve;#delay {move} {#cursor macro reset;s} {0.05}}
#macro {\e[1;5D} {#cursor macro preserve;#delay {move} {#cursor macro reset;w} {0.05}}
#macro {\e[1;5A\e[1;5A} {#undelay {move};#cursor macro reset;n;n}
#macro {\e[1;5C\e[1;5C} {#undelay {move};#cursor macro reset;e;e}
#macro {\e[1;5B\e[1;5B} {#undelay {move};#cursor macro reset;s;s}
#macro {\e[1;5D\e[1;5D} {#undelay {move};#cursor macro reset;w;w}
#macro {\e[1;5A\e[1;5B} {#undelay {move};#cursor macro reset;u}
#macro {\e[1;5B\e[1;5A} {#undelay {move};#cursor macro reset;u}
#macro {\e[1;5C\e[1;5D} {#undelay {move};#cursor macro reset;d}
#macro {\e[1;5D\e[1;5C} {#undelay {move};#cursor macro reset;d}
#macro {\e[1;5A\e[1;5C} {#undelay {move};#cursor macro reset;ne}
#macro {\e[1;5C\e[1;5A} {#undelay {move};#cursor macro reset;ne}
#macro {\e[1;5B\e[1;5C} {#undelay {move};#cursor macro reset;se}
#macro {\e[1;5C\e[1;5B} {#undelay {move};#cursor macro reset;se}
#macro {\e[1;5D\e[1;5B} {#undelay {move};#cursor macro reset;sw}
#macro {\e[1;5B\e[1;5D} {#undelay {move};#cursor macro reset;sw}
#macro {\e[1;5D\e[1;5A} {#undelay {move};#cursor macro reset;nw}
#macro {\e[1;5A\e[1;5D} {#undelay {move};#cursor macro reset;nw}
#nop -------------------------------------------------------------------------
#nop Place tells in the top 5 lines of the screen
#nop -------------------------------------------------------------------------
#VARIABLE {COMMS} {}
#ACTION {~%1 tells you %2}
{
addtowin %1 tells you %2
}
#ACTION {~%1 chats %2}
{
addtowin %1 chats %2
}
#ALIAS {addtowin}
{
#format temp {%w} {%0};
#loop {1} {&temp[]} {cnt}
{
#list COMMS ins -1 {$temp[$cnt]}
};
#while {&COMMS[] > 100}
{
#list COMMS del 1
};
showwin
}
#ALIAS {showwin}
{
#screen clear square 1 1 5 -1;
#list temp create $COMMS[-5..-1];
#loop {1} {&temp[]} {cnt}
{
#regexp {$temp[$cnt]} {^$}
{
#nop
};
#else
{
#line ignore #showme {$temp[$cnt]} {$cnt} {1}
}
}
}
#ALIAS {test}
{
#split 5 1;
#showme <138>Bubba tells you 'hello';
#showme <158>Pamela chats 'bye';
}
#nop -------------------------------------------------------------------------
#nop Display two sessions next to each other
#nop -------------------------------------------------------------------------
#event {SCREEN RESIZE}
{
#var ROWS %0;
#var COLS %1;
#draw line 1 {$COLS / 2} -3 {$COLS / 2};
#left #screen scroll 1 1 -3 {$COLS / 2 - 1};
#right #screen scroll 1 {$COLS / 2 + 1} -3 -1;
}
#event {PROGRAM START}
{
#screen raise SCREEN RESIZE;
#ses right localhost 4321;
#ses left localhost 4321;
}
#event {SESSION CREATED}
{
#var name %0;
}
#event {SESSION ACTIVATED}
{
#gts #var active %0;
}
#event {RECEIVED OUTPUT}
{
#if {"@gts{$active}" == "$name"}
{
#return;
};
#switch {"$name"}
{
#case {"left"} {#draw Red boxed foreground buffer 1 1 -3 {$COLS / 2 - 1};};
#case {"right"}{#draw Red boxed foreground buffer 1 {$COLS / 2 + 1} -3 -1};
};
}
#nop -------------------------------------------------------------------------
#nop Follow the group leader on the map.
#nop -------------------------------------------------------------------------
#var short_dir
{
{north}{n}
{northeast}{ne}
{east}{e}
{southeast}{se}
{south}{s}
{southwest}{sw}
{west}{w}
{northwest}{nw}
}
#action {%1 walks %2.$}
{
#var {follow_targets[%1]} {$short_dir[%2]}
}
#action {^You follow %1.$}
{
#if {&follow_targets[%1]}
{
#map move $follow_targets[%1]
}
}
#nop -------------------------------------------------------------------------
#nop Use mouse click to change the input cursor's position.
#nop -------------------------------------------------------------------------
#config mouse on
#split
#event {SHORT-CLICKED MOUSE BUTTON ONE -1}
{
#cursor position %1
}
#nop -------------------------------------------------------------------------
#nop Move the VT100 map from the top to the right of the screen
#nop -------------------------------------------------------------------------
#map create
#map flag vtmap
#map flag unicode
#map goto 1
#split 0 1 0 -80;
#map offset 1 82 -5 -1
#screen resize horizontal 120
#nop -------------------------------------------------------------------------
#nop Add clickable session tabs at the top of the screen
#nop -------------------------------------------------------------------------
#event {PROGRAM START}
{
#split 3 1;
#config mouse on;
#var active gts;
session_activated gts;
}
#event {SESSION CREATED}
{
#gts session_activated %0
}
#event {SESSION ACTIVATED}
{
#gts session_activated %0
}
#alias {session_activated}
{
#line sub esc #var sessions[$active] {<138>\e]68;2;TABS;#$active\a\e[4;24m$active\e[24m};
#var active {%0};
#line sub esc #var sessions[%0] {<128>\e]68;2;TABS;#nop\a\e[4;24m%0\e[24m};
#draw foreground Azure table 1 1 3 -1 {$sessions[%*]}
}
#event {PRESSED SECURE LINK TABS MOUSE BUTTON ONE}
{
%4
}
#nop -------------------------------------------------------------------------
#nop Add basic MXP link and color handling
#nop -------------------------------------------------------------------------
#config mouse on
#event {IAC DO MXP}
{
#send {\xFF\xFB\x5B\}
}
#function {mxp_link}
{
#line sub esc #var result {\e]68;1;%1;%2\a\e[4m%3\e[24m}
}
#act {~\e[1z<VERSION>} {#send {\e[4z<VERSION MXP=1.0 CLIENT=TINTIN++ VERSION=2.02.04>}}
#act {~\e[1z<SUPPORT>} {#send {\e[4z<SUPPORTS +SEND +COLOR>}}
#sub {~\e[4z<COLOR #%1>%2\e[4z</COLOR>} {<f%1>%2<900>}
#sub {~\e[4z<SEND HREF="%1">%2\e[4z</SEND>} {@mxp_link{MXP;%1;%2}}
#event {PRESSED LINK MXP MOUSE BUTTON ONE}
{
#send {%4}
}
#sub {~\e[4z{<RExits>|</RExits>|<RDesc>|</RDesc>|<PROMPT>|</PROMPT>|<RName>|</RName>}} {}
#sub {~\e[4z<RNum %d />} {}
#sub {<} {<}
#sub {>} {>}
#nop -------------------------------------------------------------------------
#nop Example script for using #list indexing.
#nop -------------------------------------------------------------------------
#var players[1] {{name}{bubba}{age}{15}{level}{24}}
#var players[2] {{name}{pamela}{age}{19}{level}{2}}
#var players[3] {{name}{ronald}{age}{69}{level}{13}}
#var players[4] {{name}{bubba}{age}{26}{level}{30}}
#var players[5] {{name}{ronald}{age}{11}{level}{31}}
#alias {display}
{
#var out {};
#loop 1 &players[] cnt
{
#var out[$cnt] {$cnt;$players[+$cnt][name];$players[+$cnt][age];$players[+$cnt][level]};
};
#draw scroll grid table 1 1 2+&players[]*2 80 $out[%*]
}
#alias {test1}
{
#list players index name;
#list players order;
display
}
#alias {test2}
{
#list players index name;
#list players order;
#list players reverse;
display;
}
#alias {test3}
{
#list players index name;
#list players order;
#list players index level;
#list players order;
display
}
#nop -------------------------------------------------------------------------
#nop This creates two input lines that can be switched between using the tab
#nop key.
#nop -------------------------------------------------------------------------
#line quiet #split
#macro {\t} {inputswitch}
#var input[width] 1
#alias {inputswitch}
{
#cursor get {input[current]};
#cursor clear;
#cursor set {$input[buffer2]};
#cursor end;
#var input[buffer2] {$input[current]};
#draw Ebony tile {-1-$input[width]} 1 -2 -1 {$input[buffer2]}
}
#nop -------------------------------------------------------------------------
#nop This allows for split screen scroll back, just use the mouse wheel in
#nop the upper half of the screen.
#nop -------------------------------------------------------------------------
#event {PROGRAM START}
{
#config mouse on;
#var SCROLL[MODE] 0;
#split 0 1;
#screen raise SCREEN RESIZE;
}
#event {SCREEN RESIZE}
{
#var ROWS %0;
#var COLS %1;
#screen get SCROLL_TOP_ROW SCROLL[TOP_ROW];
#screen get SCROLL_TOP_COL SCROLL[TOP_COL];
#screen get SCROLL_BOT_ROW SCROLL[BOT_ROW];
#screen get SCROLL_BOT_COL SCROLL[BOT_COL];
}
#EVENT {SCROLLED MOUSE WHEEL UP}
{
#if {$SCROLL[MODE] == 0}
{
#if {%0 < $ROWS / 2}
{
#var SCROLL[MODE] 1;
#var SCROLL[OLD_ROW] $SCROLL[BOT_ROW];
#math SCROLL[BOT_ROW] $SCROLL[OLD_ROW] / 2;
#var BUFFER {};
#screen scroll $SCROLL[TOP_ROW] $SCROLL[TOP_COL] $SCROLL[BOT_ROW] $SCROLL[BOT_COL];
#draw red teed line $SCROLL[BOT_ROW]+1 $SCROLL[TOP_COL] $SCROLL[BOT_ROW]+1 $SCROLL[BOT_COL];
#screen clear square $SCROLL[BOT_ROW]+2 $SCROLL[TOP_COL] $SCROLL[OLD_ROW] $SCROLL[BOT_COL];
};
};
#if {$SCROLL[MODE] == 1}
{
#buffer up 1
}
}
#EVENT {SCROLLED MOUSE WHEEL DOWN}
{
#if {$SCROLL[MODE] == 1}
{
#if {%0 < $ROWS / 2}
{
#buffer down 1;
#buffer info save SCROLL[INFO];
#if {$SCROLL[INFO][LINE] == -1}
{
#var SCROLL[MODE] 0;
#var SCROLL[BOT_ROW] $SCROLL[OLD_ROW];
#split 0 1;
#buffer end;
}
}
}
}
#event {RECEIVED LINE}
{
#if {$SCROLL[MODE] == 1}
{
#if {&BUFFER[] > $ROWS}
{
#list BUFFER del 1
};
#list BUFFER add {%0};
#draw tile $SCROLL[BOT_ROW]+2 $SCROLL[TOP_COL] $SCROLL[OLD_ROW] $SCROLL[BOT_COL] $BUFFER[%*];
}
}
#nop -------------------------------------------------------------------------
#nop This is a script to connect to Gemstone 4.
#nop Visit play.net/gs4, login, and hit the 'GO PLAY' button.
#nop Select the Storm Front radio button and hit the 'GO PLAY' button.
#nop Save the .sal file to your script directory and name it gemstone.sal.
#nop Use the 'gemstone' alias to connect.
#nop -------------------------------------------------------------------------
#alias {gemstone}
{
#var gemstone {};
#line oneshot #action {^GAMEHOST=%*} {#var gemstone[host] %%1};
#line oneshot #action {^GAMEPORT=%*} {#var gemstone[port] %%1};
#line oneshot #action {^KEY=%*} {#var gemstone[key] %%1};
#scan txt gemstone.sal;
#if {&gemstone[] != 3}
{
#showme Failed to load gemstone.sal file.;
#return
};
#ses gemstone $gemstone[host] $gemstone[port];
#send {$gemstone[key]};
#send {>/FE:JAVA}
}
#nop -------------------------------------------------------------------------
#nop Start a dated log file in the logs directory when a session connects. See
#nop #help time for the available date options for #format %t.
#nop -------------------------------------------------------------------------
#event {SESSION CONNECTED}
{
#format date %t %Y-%m-%d-%H-%M;
#log append logs/%0_$date.log
}
#nop -------------------------------------------------------------------------
#nop Sometimes an error doesn't give enough information and it's useful to
#nop see the calling script.
#nop -------------------------------------------------------------------------
#event {RECEIVED ERROR}
{
#echo <118>%h { TOKENIZER };
#info tokenizer -1;
#echo <118>%h
}
#nop -------------------------------------------------------------------------
#nop It can be annoying to have short commands clog up the command history.
#nop This script will remove commands shorter than 3 letters.
#nop -------------------------------------------------------------------------
#event {HISTORY UPDATE}
{
#if {{%0} != {%+3*%*}}
{
#history delete
}
}
#nop -------------------------------------------------------------------------
#nop Run to a room when you click it on the vtmap.
#nop -------------------------------------------------------------------------
#config mouse on
#event {MAP SHORT-CLICKED MOUSE BUTTON ONE}
{
#map run {%0} 0.25
}
#nop -------------------------------------------------------------------------
#nop zMUD has the feature where your last command is highlighted and any input
#nop other than enter will clear it. This scripts reproduces this behavior.
#nop -------------------------------------------------------------------------
#CONFIG REPEAT_ENTER ON
#event {HISTORY UPDATE}
{
#delay 0 #line ignore #showme {<aaf><FFF><788>%0<088>} {-1};
#var last_input {%0}
}
#event {PROCESSED KEYPRESS}
{
#if {{%1} != {10} && {$last_input} !== {}}
{
#var last_input {};
#line ignore #showme {} {-1};
#cursor end;
#history insert {}
}
}
#nop -------------------------------------------------------------------------
#nop
#nop -------------------------------------------------------------------------