Commit 7843bda61eb489ee9e8a1a32de9d95cb1fbdcc10

Various and sundry changes.
Looking to see if Git will work after moving the repository to a new
drive.
obj/Handler.o
(74 / 67)
Binary files differ
obj/gaze.o
(41 / 44)
Binary files differ
  
55IMPORT Message, FormStr;
66
77PROCEDURE EightBall(parse: Message.Parse);
8CONST
9 CHOICES = 42;
810VAR
911 result : Message.strType;
10 answers : ARRAY [0..42] OF ARRAY [0..29] OF CHAR;
12 answers : ARRAY [0..CHOICES] OF ARRAY [0..29] OF CHAR;
1113 choice : INTEGER;
1214BEGIN
1315 seed := millisecs(); (* re-seed the random number generator *)
5858 answers[41] := "Don't bet on it.";
5959 answers[42] := 'Forget about it.';
6060
61 choice := RandInt(0, 42);
61 choice := RandInt(0, CHOICES);
6262 FormStr.print(result, "%s shakes the magic 8-ball... %s", parse.botname, answers[choice]);
6363 Message.PrintLine(parse.chan, result);
6464EXCEPT
  
211211 IF RegComp.Match(re, msg, 0) THEN
212212 FormStr.print(msg, "Why don't you take a photo %s, it will last longer.", parse.nick);
213213 PrintLine(parse.chan, msg);
214 END;
215
216 RegComp.Compile('*PETS PAGE_SIX*', re, regexres);
217 IF RegComp.Match(re, msg, 0) THEN
218 FormStr.print(msg, "I wish you'd use an anti-static wriststrap when you do that...");
219 PrintLine(parse.chan, msg);
214220 END;
221
222 RegComp.Compile('*THE CARPET GENERATING A HUGE LOAD*', re, regexres);
223 IF RegComp.Match(re, msg, 0) THEN
224 FormStr.print(msg, "Now that's a smart thing for a bot to be doing catbot....");
225 PrintLine(parse.chan, msg);
226 END;
215227 (* End of testing stuff *)
216228
217229 (* the bot name was found in parse.raw *)
475475 Left("LICENSE ", cmd) THEN gaze.license(parse) END;
476476(* Gaze Maintainer *)
477477 IF Left("GAZE MAINTAINER ", cmd) OR
478 Left("MAINTAINER ", cmd) THEN gaze.maintainer(parse) END;
478 Left("MAINTAINER ", cmd) THEN (* gaze.maintainer(parse) END; *)
479 PrintLine(parse.chan, "The !maintainer command is temporarily disabled.") END;
479480(* Gaze md5 *)
480481 IF Left("GAZE MD5 ", cmd) OR
481482 Left("MD5 ", cmd) THEN gaze.md5(parse) END;
  
4040 currentOnTimer,
4141 forumCheckTimer,
4242 trackerCheckTimer,
43 bugCheckTimer : CARDINAL;
43 bugCheckTimer,
44 signOnTimeCard : CARDINAL;
4445 pidBC : types.pid_t;
4546
4647(* Delay for the appropriate number of seconds *)
48(* Should use unistd.sleep or something *)
4749PROCEDURE Delay(seconds : CARDINAL);
4850VAR
4951 delayStart : CARDINAL;
6666 DoSend(parse.serv,pingString);
6767 parse := DoRead(parse.serv);
6868 RETURN TRUE;
69
70 (*
71 GetClock(pingTime);
72 Assign("PING ",pingString);
73 Append(parse.server,pingString);
74 IntToStr(millisecs(),str);
75 Append(" HIA",pingString);
76 Append(str, pingString);
77 DoSend(parse.serv,pingString);
78 parse := DoRead(parse.serv);
79 RETURN TRUE;
80 *)
8169END PingServer;
8270
83
84
8571PROCEDURE Timing(): BOOLEAN;
8672VAR
8773 statloc, statlocBC : INTEGER;
88
8974BEGIN
9075 (* get rid of any child processes that have died *)
9176 wait.waitpid( -1, statloc, wait.WNOHANG );
103103END Timing;
104104
105105BEGIN
106 seconds := time();
107 GetClock(signOnTime);
106 (* Use time() to get sign on time - GetClock seems to have problems *)
107 signOnTimeCard := time();
108
109 seconds := time(); (* I'm not sure where this is used anymore *)
110 GetClock(signOnTime);
108111 signOnSeconds := time();
109112 pingTimer := time();
110113 GetClock(pingTime);
  
201201 (* Delete the target *)
202202 Strings.FindNext(")", result, 0, found, pos);
203203 Strings.Delete(result, 0, pos+2);
204
204 IF StringParse.InString("is not a spell", result) THEN
205 FormStr.print(result, "%s is not a spell.", target);
206 END;
205207 Message.PrintLine(parse.chan, result);
206208EXCEPT
207209 RETURN
451451 END;
452452
453453 (* Everything looks good *)
454 FormStr.print(command, "gaze -q maintainer %s | awk '{ print $0 }'", target);
454 FormStr.print(command, "gaze -q maintainer %s | tr '\n' '|' | sed 's/|/\ |\ /g' | sort | uniq | awk '{ print $0 }'", target);
455455
456456 p6Fifo.writeFIFO(command);
457457 p6Fifo.readFIFO(maintainer);
845845 str := "T~: Version: R~";
846846 StringParse.Replace(str, "T~", target);
847847 StringParse.Replace(str, "R~", result);
848 Strings.Append(" (most 'stable' version. Use !versions for complete list)", str);
848849 Message.PrintLine(parse.chan, str);
849850 ELSE
850851 Sorry(parse, target);
src/s.mod
(4 / 9)
  
2020(* Pre: bot name, say, channel to speak on, what to say *)
2121(* Post: Say desired comment on the channel requested. *)
2222VAR
23 command,string, part1, part2 : Message.strType;
23 command, string, part1, part2 : Message.strType;
2424
2525BEGIN
2626 command := parse.cmd;
6464
6565BEGIN
6666 Strings.Concat(parse.nick, ", I signed on at ", string);
67 (* Hour *)
6768 WholeStr.CardToStr(Timers.signOnTime.hour, temp);
6869 IF LENGTH(temp)=1 THEN
6970 Strings.Concat("0", temp, temp);
70 (* Try doing temp to temp, if it doesn't work, uncomment this
71 Strings.Concat("0", temp, temp2);
72 temp := temp2;
73 *)
7471 END;
7572 Strings.Concat(string, temp, string);
7673 Strings.Concat(string, ":", string);
74 (* Minute *)
7775 WholeStr.CardToStr(Timers.signOnTime.minute, temp);
7876 IF LENGTH(temp)=1 THEN
7977 Strings.Concat("0", temp, temp);
80 (* Again...
81 Strings.Concat("0", temp, temp2);
82 temp := temp2;
83 *)
8478 END;
8579
8680 Strings.Concat(string, temp, string);
346346END SpellsSorcerer;
347347
348348(***********************************************************)
349(* Need to start using Timers.signOnTimeCard - and work directly with seconds. *)
349350PROCEDURE Status(parse : Message.Parse);
350351VAR
351352 string, trueString : Message.strType;