Commit 7843bda61eb489ee9e8a1a32de9d95cb1fbdcc10
- Diff rendering mode:
- inline
- side by side
obj/Handler.o
(74 / 67)
Binary files differ
obj/gaze.o
(41 / 44)
Binary files differ
src/EightBall.mod
(4 / 2)
|   | |||
| 5 | 5 | IMPORT Message, FormStr; | |
| 6 | 6 | ||
| 7 | 7 | PROCEDURE EightBall(parse: Message.Parse); | |
| 8 | CONST | ||
| 9 | CHOICES = 42; | ||
| 8 | 10 | VAR | |
| 9 | 11 | 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; | ||
| 11 | 13 | choice : INTEGER; | |
| 12 | 14 | BEGIN | |
| 13 | 15 | seed := millisecs(); (* re-seed the random number generator *) | |
| … | … | ||
| 58 | 58 | answers[41] := "Don't bet on it."; | |
| 59 | 59 | answers[42] := 'Forget about it.'; | |
| 60 | 60 | ||
| 61 | choice := RandInt(0, 42); | ||
| 61 | choice := RandInt(0, CHOICES); | ||
| 62 | 62 | FormStr.print(result, "%s shakes the magic 8-ball... %s", parse.botname, answers[choice]); | |
| 63 | 63 | Message.PrintLine(parse.chan, result); | |
| 64 | 64 | EXCEPT |
src/Handler.mod
(14 / 1)
|   | |||
| 211 | 211 | IF RegComp.Match(re, msg, 0) THEN | |
| 212 | 212 | FormStr.print(msg, "Why don't you take a photo %s, it will last longer.", parse.nick); | |
| 213 | 213 | 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); | ||
| 214 | 220 | 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; | ||
| 215 | 227 | (* End of testing stuff *) | |
| 216 | 228 | ||
| 217 | 229 | (* the bot name was found in parse.raw *) | |
| … | … | ||
| 475 | 475 | Left("LICENSE ", cmd) THEN gaze.license(parse) END; | |
| 476 | 476 | (* Gaze Maintainer *) | |
| 477 | 477 | 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; | ||
| 479 | 480 | (* Gaze md5 *) | |
| 480 | 481 | IF Left("GAZE MD5 ", cmd) OR | |
| 481 | 482 | Left("MD5 ", cmd) THEN gaze.md5(parse) END; |
src/Timers.mod
(8 / 18)
|   | |||
| 40 | 40 | currentOnTimer, | |
| 41 | 41 | forumCheckTimer, | |
| 42 | 42 | trackerCheckTimer, | |
| 43 | bugCheckTimer : CARDINAL; | ||
| 43 | bugCheckTimer, | ||
| 44 | signOnTimeCard : CARDINAL; | ||
| 44 | 45 | pidBC : types.pid_t; | |
| 45 | 46 | ||
| 46 | 47 | (* Delay for the appropriate number of seconds *) | |
| 48 | (* Should use unistd.sleep or something *) | ||
| 47 | 49 | PROCEDURE Delay(seconds : CARDINAL); | |
| 48 | 50 | VAR | |
| 49 | 51 | delayStart : CARDINAL; | |
| … | … | ||
| 66 | 66 | DoSend(parse.serv,pingString); | |
| 67 | 67 | parse := DoRead(parse.serv); | |
| 68 | 68 | 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 | *) | ||
| 81 | 69 | END PingServer; | |
| 82 | 70 | ||
| 83 | |||
| 84 | |||
| 85 | 71 | PROCEDURE Timing(): BOOLEAN; | |
| 86 | 72 | VAR | |
| 87 | 73 | statloc, statlocBC : INTEGER; | |
| 88 | |||
| 89 | 74 | BEGIN | |
| 90 | 75 | (* get rid of any child processes that have died *) | |
| 91 | 76 | wait.waitpid( -1, statloc, wait.WNOHANG ); | |
| … | … | ||
| 103 | 103 | END Timing; | |
| 104 | 104 | ||
| 105 | 105 | BEGIN | |
| 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); | ||
| 108 | 111 | signOnSeconds := time(); | |
| 109 | 112 | pingTimer := time(); | |
| 110 | 113 | GetClock(pingTime); |
src/gaze.mod
(5 / 2)
|   | |||
| 201 | 201 | (* Delete the target *) | |
| 202 | 202 | Strings.FindNext(")", result, 0, found, pos); | |
| 203 | 203 | 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; | ||
| 205 | 207 | Message.PrintLine(parse.chan, result); | |
| 206 | 208 | EXCEPT | |
| 207 | 209 | RETURN | |
| … | … | ||
| 451 | 451 | END; | |
| 452 | 452 | ||
| 453 | 453 | (* 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); | ||
| 455 | 455 | ||
| 456 | 456 | p6Fifo.writeFIFO(command); | |
| 457 | 457 | p6Fifo.readFIFO(maintainer); | |
| … | … | ||
| 845 | 845 | str := "T~: Version: R~"; | |
| 846 | 846 | StringParse.Replace(str, "T~", target); | |
| 847 | 847 | StringParse.Replace(str, "R~", result); | |
| 848 | Strings.Append(" (most 'stable' version. Use !versions for complete list)", str); | ||
| 848 | 849 | Message.PrintLine(parse.chan, str); | |
| 849 | 850 | ELSE | |
| 850 | 851 | Sorry(parse, target); |
src/s.mod
(4 / 9)
|   | |||
| 20 | 20 | (* Pre: bot name, say, channel to speak on, what to say *) | |
| 21 | 21 | (* Post: Say desired comment on the channel requested. *) | |
| 22 | 22 | VAR | |
| 23 | command,string, part1, part2 : Message.strType; | ||
| 23 | command, string, part1, part2 : Message.strType; | ||
| 24 | 24 | ||
| 25 | 25 | BEGIN | |
| 26 | 26 | command := parse.cmd; | |
| … | … | ||
| 64 | 64 | ||
| 65 | 65 | BEGIN | |
| 66 | 66 | Strings.Concat(parse.nick, ", I signed on at ", string); | |
| 67 | (* Hour *) | ||
| 67 | 68 | WholeStr.CardToStr(Timers.signOnTime.hour, temp); | |
| 68 | 69 | IF LENGTH(temp)=1 THEN | |
| 69 | 70 | 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 | *) | ||
| 74 | 71 | END; | |
| 75 | 72 | Strings.Concat(string, temp, string); | |
| 76 | 73 | Strings.Concat(string, ":", string); | |
| 74 | (* Minute *) | ||
| 77 | 75 | WholeStr.CardToStr(Timers.signOnTime.minute, temp); | |
| 78 | 76 | IF LENGTH(temp)=1 THEN | |
| 79 | 77 | Strings.Concat("0", temp, temp); | |
| 80 | (* Again... | ||
| 81 | Strings.Concat("0", temp, temp2); | ||
| 82 | temp := temp2; | ||
| 83 | *) | ||
| 84 | 78 | END; | |
| 85 | 79 | ||
| 86 | 80 | Strings.Concat(string, temp, string); | |
| … | … | ||
| 346 | 346 | END SpellsSorcerer; | |
| 347 | 347 | ||
| 348 | 348 | (***********************************************************) | |
| 349 | (* Need to start using Timers.signOnTimeCard - and work directly with seconds. *) | ||
| 349 | 350 | PROCEDURE Status(parse : Message.Parse); | |
| 350 | 351 | VAR | |
| 351 | 352 | string, trueString : Message.strType; |

