Advertisement
xosski

calc2

Nov 2nd, 2024
4
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. on *:input:#:{ doit $1 $chan }
  2. on *:text:*:#:{ doit $1 $chan $nick }
  3.  
  4. alias -l doit {
  5. var %r = $mid($1,2), %rx = $+(%r,:), %f = $qt($+(C:\textfiles1\,%r,.txt)), %target = $iif($istok(?articles ?commands,$1,32),$3,$2)
  6. if (!%target) {
  7. echo -as [ERROR] Invalid target.
  8. return
  9. }
  10. if ($1 == ?stop) { .play stop }
  11. elseif ($1 == ?commands) { getcommands %target }
  12. elseif ($isfile(%f) && $left($1,1) == ?) {
  13. .play stop
  14. echo -sa %rx triggered
  15. echo -sa %rx found file
  16. .play -m1 %target %f 6000
  17. echo -sa %rx finished
  18. }
  19. }
  20.  
  21. alias -l getcommands {
  22. var %a = 1, %b, %c, %total
  23. while ($findfile(C:\textfiles\,*.txt,%a,0)) {
  24. %b = $v1
  25. %c = %c $+(?,$remove($nopath(%b),.txt))
  26. inc %a
  27. }
  28. %c = $sorttok(%c,32)
  29. %total = $findfile(C:\textfiles\,*.txt,0)
  30. var %a = 1, %b = 10, %t = 2
  31. .notice $1 Commands %total $+ :
  32. while ($gettok(%c,%a - $calc(%a + $calc(%b - 1)),32) != $null) { .timer -o 1 %t .notice $1 $+($chr(3),07,$v1,$chr(3)) | inc %t 2 | inc %a %b }
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement