Guest User

Untitled

a guest
Feb 28th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 1.85 KB | None | 0 0
  1. #!/bin/sh
  2. #   /usr/bin/tclsh8.5 \
  3. exec tclsh "$0" "$@"
  4.  
  5. # A quick little wrapper for the script to do quick testing of things like regexp
  6. # at the cli.  Much nicer than rehashing the bot and spamming the channels a lot.
  7. # of course, you can only propperly test certain things to an extent this way
  8. # unless you go all the way and actually parse the user file, etc.  Tho, this suffices.
  9. # Prob. left some fake proc's in here that are not needed, tho. Yet again, it's
  10. # stripped from my main script.  Tho, much smaller like this ^.^
  11. proc channel { argy argx argz } {return 1}
  12. proc channels {} {return [list "#madscript" "#shr-staff"]}
  13. proc dputs {x} { puts "[unixtime]:$x" }
  14. proc putlog {x} {puts "[clock seconds]:$x"}
  15. proc puthelp {x {extra "-normal"}} {puts "$x"}
  16. proc putserv {x {extra "-normal"}} {puts "$x"}
  17. proc putquick {x {extra "-normal"}} {puts "$x"}
  18. proc ctime {x} {return [clock format $x -format {Y:%Y m:%m d:%d %H:%M:%S}]}
  19. proc timer {argv argy} {return "time[expr {int(rand()*200)}]"}
  20. proc utimer {argv argy} {return "time[expr {int(rand()*200)}]"}
  21. proc unixtime { } { return [clock seconds]}
  22. proc validchan {x} { return 1 }
  23. proc botonchan {x} { return 1 }
  24. proc getchanmode {x} { return 1 }
  25. proc setudef {argv argy} { return 1 }
  26. proc bind {a b c d} { return 1 }
  27. proc matchattr {argv argy} { return 0}
  28. proc putloglev {x channel argv} { puts "$argv" }
  29.  
  30. #load SA_urltitle.tcl
  31. if {[catch {source SA_urltitle.tcl} errmsg]} {
  32.   puts "Error: $errmsg"
  33.   return
  34. }
  35.  
  36. if {![string length $argv]} {
  37.   puts "SA_urltitle.tcl cli test script."
  38.   puts [string repeat # 64]
  39.   puts "# Usage: $argv0 <url|string containing a url('s)> #"
  40.   puts [string repeat # 64]
  41.   return
  42. }
  43.  
  44. set cliDebug 1 ;# display extra debug info. Tho I remove them before pushing to master mostly.
  45.  
  46. pub_url "unitTestnick" "uniTestHost" "unitTestHand" "#unitTestChannel" $argv
  47. return
Add Comment
Please, Sign In to add comment