Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.88 KB | None | 0 0
  1. alias top10 {
  2. var %i = $var(%SA.*,0)
  3. while (%i > 0) {
  4. writeini fightstats.ini $var(%SA.*,%i) wins $var(%SA.*,%i).value
  5. dec %i
  6. }
  7. fightrank
  8. }
  9.  
  10. alias statread3 { return $readini(fightstats.ini,$1,$2) }
  11.  
  12. alias fightrank {
  13. window -c @rankings
  14. var %i = $ini(fightstats.ini,0)
  15. window -lne @rankings
  16. while (%i > 0) {
  17. aline @rankings $statread3($ini(fightstats.ini,%i),wins) $ini(fightstats.ini,%i)
  18. dec %i
  19. }
  20. filter -ctue 1 10 @rankings @rankings
  21. write -c fightranks.txt
  22. var %i = 1
  23. var %i2 = $calc($line(@rankings,0) +1)
  24. while (%i < %i2) {
  25. write fightranks.txt $ord(%i) $+ ) $gettok($gettok($gettok($line(@rankings,%i),2,32),1,33),2,46) [Points: $gettok($line(@rankings,%i),1,32) $+ ]
  26. inc %i
  27. }
  28. msg %top10chan 7,1Top 10 Fighters:
  29. var %i = 1
  30. while (%i < 11) {
  31. msg $chan $read(fightranks.txt, %i)
  32. inc %i
  33. }
  34. return
  35. }
  36.  
  37.  
  38. on *:TEXT:!Fight*:#:{
  39. if (%flfight. [ $+ [ $address($nick,6) ] ] >= 5) { halt }
  40. if (%flfight. [ $+ [ $address($nick,6) ] ] == 3) { .notice $nick You have one more !fight use within a 30 second period. }
  41. inc -u30 %flfight. [ $+ [ $address($nick,6) ] ] 1
  42. if ($2 == $nick) { .msg $chan You cannot attack yourself dumbass, stop trying to cheat! | halt }
  43. if ($2 == $me) { .msg $chan You cannot attack the Bot dumbass, stop trying to cheat! | halt }
  44. if ($2 == Refbot) { .msg $chan You cannot attack RefBot dumbass, stop trying to cheat! | halt }
  45. if ($2 == help) { .notice $nick Fight Help Commands are: !fight, !fight Stats, !fight help | halt }
  46. if ($2 == top10) {
  47. if (%top10flood != $null) { .notice $nick Top 10 command was recently used on %top10chan $+ . Please wait at least 30 seconds before using it again to prevent flooding | return }
  48. else { set -u30 %top10flood on | set %top10chan $chan | top10 | return }
  49. }
  50. if ($2 == stats) {
  51. if ($3) {
  52. if (!%SA. [ $+ [ $address($3,2) ] ]) { .msg $chan There is no Attack Record for $3 $+ . | halt }
  53. .msg $chan 7,1 $+ $3 $+ 14's Fight stats:0 %SA. [ $+ [ $address($3,2) ] ]
  54. }
  55. else { .notice $nick Syntax: !fight stats nickname }
  56. halt
  57. }
  58. if ($2) {
  59. .timersavefight 1 3600 save -rv Fight.ini
  60. if ($2 ison $chan) {
  61. var %sa $calc(%SA. [ $+ [ $address($nick,6) ] ] + $r(1,10) / 10)
  62. var %da $calc(%SA. [ $+ [ $address($2,6) ] ] + $r(1,10) / 10)
  63. if (%sa == %da) {
  64. msg $chan the Fight is a 13draw! Your Experience:9 %sa vs $2 $+ 's Experience:9 %da 
  65. set %SA. [ $+ [ $address($nick,6) ] ] $calc(%SA. [ $+ [ $address($nick,6) ] ] + $r(1,30) / 10)
  66. set %SA. [ $+ [ $address($2,6) ] ] $calc(%SA. [ $+ [ $address($2,6) ] ] + $r(1,30) / 10)
  67. ;**************************************Fight - by newklear 2018***************************************
  68. }
  69. }
  70.  
  71. if (%sa > %da) {
  72. set %SA. [ $+ [ $address($nick,6) ] ] $calc(%SA. [ $+ [ $address($nick,6) ] ] + $r(1,30) / 10)
  73. set %SA. [ $+ [ $address($2,6) ] ] $calc(%SA. [ $+ [ $address($2,6) ] ] + $r(1,70) / 10)
  74. msg $chan 7,01 $+ $nick 14has 9beaten7 $2 $+ 14!7 $nick $+ 14's Attack was:0 %sa 14and was larger than7 $2 $+ 14's Defence of:0 %da
  75. msg $chan 7,01 $+ $nick $+ 14's fight stats is now:0 %SA. [ $+ [ $address($nick,6) ] ] 14& 7 $+ $2 $+ 14's fight stats is now:0 %SA. [ $+ [ $address($2,6) ] ]
  76. }
  77. }
  78.  
  79.  
  80. if (%sa < %da) {
  81. set %SA. [ $+ [ $address($nick,6) ] ] $calc(%SA. [ $+ [ $address($nick,6) ] ] + $r(1,60) / 10)
  82. set %SA. [ $+ [ $address($2,6) ] ] $calc(%SA. [ $+ [ $address($2,6) ] ] + $r(1,40) / 10)
  83. msg $chan 7,01 $+ $nick 14has 4lost14 to7 $2 $+ 14! 7 $+ $nick $+ 14's Attack was:0 %sa 14and was lower than7 $2 $+ 14's Defence of:0 %da
  84. msg $chan 7,01 $+ $2 $+ 14's fight stats is now:0 %SA. [ $+ [ $address($2,6) ] ] 14& 7 $+ $nick $+ 14's fight stats is now:0 %SA. [ $+ [ $address($nick,6) ] ]
  85. }
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement