Commits

lan Nomar committed 5828fe1

bot/autoreply external commands no longer work (wordaround)

  • Participants
  • Parent commits 33cf588

Comments (0)

Files changed (2)

 #!/bin/brc
 
+echo $*
+
+nick = Monevii
+
 dir		= $^*
 outF	= $^*/out
 inF		= $^*/in
 
 tail -n0 -f $^outF | \
  while ( true ) {
-  msg=`{ ask }
-   if ( ~ $msg(3) '-!-' && ~ $msg(6) joined ) {
-	user = `` ('(') { echo -n $msg(4) }
-		user = $user(1)
-	echo /MODE $chan +o $user  > $inF
- } }
+  *=`{ ask }
+   ~ $3 '-!-' && ~ $8 '+o'^* && ~ $* $nick && break
+ }
+
+tail -n0 -f $^outF | \
+  while ( true ) {
+   msg=`{ ask }
+	if ( ~ $msg(3) '-!-' && ~ $msg(6) joined ) {
+		user = `` ('(') { echo -n $msg(4) }
+			user = $user(1)
+		echo /MODE $chan +o $user  > $inF
+} }

bot/autoreply.brc

 	ifs=$ifs { ifs=()
         *=`{ urlencode $* } }
 
-		w3m -dump definefor.me/^$^* | awk '!/wordnik/ && NR!=1 && NR!=2 && NR!=3 && NR!=4' | sed '10q'
+		w3m -dump definefor.me/^$^* |\
+			awk '!/wordnik/ && NR!=1 && NR!=2 && NR!=3 && NR!=4' # | sed '10q'
 }
+
 fn Quote {
 	if ( ~ $#* 0 ) {
 		tail -n1 $^dbF
 fn listen { *=`{ rcplayer notify stdout | sed 1q }
 	echo -n 'Listening to:' $^* }
 
-
+fn Gtranslate {
+	* = `` () { gtranslate $* }
+	~ $* /* && * = .^$^*
+	echo $*
+}
 
 dir		= $*
 inF 	= $*/in 
 			case listen*				;	listen > $^inF
 
 			case [Dd][Ee][Ff]*	; shift 5 ; define $*		> $^inF
-			case [Tt][Rr]*		; shift 5 ; gtranslate $*	> $^inF
+			case [Tt][Rr]*		; shift 5 ; Gtranslate $*	> $^inF
 			case 2?? ??2?? ??^'-'^??^2^* *^2^??^'-'^??
-				shift 4 ; gtranslate	$* > $^inF
+				shift 4 ; Gtranslate	$* > $^inF
 
 			case [Ff][Tt][Hh]
 				shift 5
 			case [Qq]^[Ll]ist [Qq][Ll][Ss]
 					echo $^user: There are $qls items on the DB > $inF
 
-			case help ayuda
+			case [hH] help ayuda
 				echo $user: Solo acepto '(' $cmds ')' > $inF
 		}
 	}