Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- External commands pack
- */
- #include "xchat-plugin.h"
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #include <ctype.h>
- #define PNAME "External commands pack"
- #define PDESC "8====D~~~~~~"
- #define PVERSION "0.05"
- static xchat_plugin *ph; /* plugin handle */
- #define any_lowercase_letter case 'a':case 'b':case'c':case'd':case'e':case'f':case 'g':case 'h':case 'i':case 'j':case 'k':case 'l':case'm':case'n':case'o':case'p':case 'q':case 'r':case 's':case 't':case 'u':case 'v':case'w':case'x':case'y':case'z':
- #define any_decimal_digit case '0':case '1':case'2':case'3':case'4':case'5':case '6':case '7': case '8':case '9':
- #include "rscript.c"
- int ReadDate3(char *Peek) {
- if(!strcasecmp(Peek, "now"))
- return time(NULL);
- int Month, Day, Year;
- if(!Peek[0]) return -1;
- Month = strtol(Peek, &Peek, 10);
- if(*Peek=='/') Peek++;
- if(!Peek[0]) return -1;
- Day = strtol(Peek, &Peek, 10);
- if(*Peek=='/') Peek++;
- if(!Peek[0]) return -1;
- Year = strtol(Peek, NULL, 10);
- time_t RawTime;
- struct tm *TimeInfo;
- time( &RawTime );
- TimeInfo = localtime ( &RawTime );
- TimeInfo->tm_year = Year - 1900;
- TimeInfo->tm_mon = Month - 1;
- TimeInfo->tm_mday = Day;
- return mktime(TimeInfo);
- }
- char *BruteforceKrypto(int n1, int n2, int n3, int n4, int n5, int Desired, char *Poke) {
- int N[5] = {n1,n2,n3,n4,n5};
- int A,B,C,D,E,i;
- int Op[5];
- const char OpChar[4] = {'+', '-', '*', '/'};
- for(A=0;A<5;A++) {
- for(B=0;B<5;B++) {
- if(B==A)
- continue;
- for(C=0;C<5;C++) {
- if(C==A || C==B)
- continue;
- for(D=0;D<5;D++) {
- if(D==A || D==B || D==C)
- continue;
- for(E=0;E<5;E++) {
- if(E==A || E==B || E==C || E==D)
- continue;
- // will loop 120 times
- float W[5] = {N[A], N[B], N[C], N[D], N[E]};
- float Val=W[0];
- for(Op[0]=0;Op[0]<4;Op[0]++)
- for(Op[1]=0;Op[1]<4;Op[1]++)
- for(Op[2]=0;Op[2]<4;Op[2]++)
- for(Op[3]=0;Op[3]<4;Op[3]++) {
- for(Val=W[0], i=0; i<4; i++)
- switch(Op[i]) {
- case 0:
- Val += W[i+1];
- break;
- case 1:
- Val -= W[i+1];
- break;
- case 2:
- Val *= W[i+1];
- break;
- case 3:
- Val /= W[i+1];
- break;
- }
- if(Val == Desired) {
- sprintf(Poke, "%2i %c %2i %c %2i %c %2i %c %2i = %2i \n",
- (int)W[0], OpChar[Op[0]], (int)W[1], OpChar[Op[1]], (int)W[2], OpChar[Op[2]],
- (int)W[3], OpChar[Op[3]], (int)W[4], Desired);
- return Poke;
- }
- }
- }
- }
- }
- }
- }
- return "No solutions?";
- }
- //Convert a string to an integer, and notes a '%' or '$' starting a number
- int ConvertCA65Num(char *In, char **Out) {
- char *Peek=In; //Start at the input string
- while(isspace(*Peek)) { //Skip to the end of any leading whitespace before the number
- Peek++;
- if(*Peek=='\0') //Handle the whole string being whitespace, if it happens
- return(0);
- }
- if(*Peek=='$') //Prefixed with a '$' = Hexadecimal
- return(strtol(Peek+1, Out, 16 ));
- if(*Peek=='%') //Prefixed with a '%' = Binary
- return(strtol(Peek+1, Out, 2 ));
- return(strtol(Peek, Out, 10 )); //Not prefixed with anything = Decimal
- }
- static char *z80FakeMultiply(char *Result, int Find) { // nb.zmulbyadd
- char Temp[100];
- Temp[99]=0; // String end
- if(Find==-1){strcpy(Result,"neg"); return(Result);}
- if(Find==0){strcpy(Result,"xor a"); return(Result);}
- if(Find==1){strcpy(Result,"nop"); return(Result);}
- if(Find<0){strcpy(Result,"Only positive numbers, please"); return(Result);}
- char *Poke = Temp+98;
- while(Find != 1) {
- if(Find & 1) {
- Find--;
- *(Poke--) = 'y';
- } else {
- Find>>=1;
- *(Poke--) = 'x';
- }
- printf("%i ", Find);
- }
- strcpy(Result, ++Poke);
- printf("\nResult is %s \n", Poke);
- return(Result);
- }
- static void z80Asm(char *Input, char *Output) {
- remove("lazyass.bin");
- // First we need to create a file to feed z80asm
- FILE *MyFile = fopen("lazyass.asm","w");
- if(MyFile==NULL) {
- strcpy(Output,"unable to open lazyass.asm");
- return;
- }
- // Intercept all '\'s and turn them into newlines
- char *Peek = Input;
- while(*Peek) {
- char got = *Peek;
- if(got == '\\') { // new line
- fputc('\r',MyFile);
- fputc('\n',MyFile);
- }
- else
- fputc(got, MyFile);
- Peek++;
- }
- // Now we have a file to feed z80asm
- fclose(MyFile);
- char Command[512];
- sprintf(Command, "z80asm -i lazyass.asm -o lazyass.bin");
- int Status = system(Command);
- // Open the assembled code
- MyFile = fopen("lazyass.bin","rb");
- if(MyFile==NULL) {
- sprintf(Output,"Unable to open lazyass.bin. (system() returned %i) I'm guessing you made a mistake in your code", Status);
- return;
- }
- // Now get the hex values from the compiled code
- strcpy(Output,"");
- char *Poke = Output;
- // int len=0; // code length
- int ch;
- do {
- char Small[7];
- ch = fgetc(MyFile);
- if(ch==EOF)
- break;
- if(ch < 16)
- sprintf(Small, "0%x ",ch);
- else
- sprintf(Small, "%x ",ch);
- strcat(Poke,Small);
- } while(ch != EOF);
- }
- static void NBFalse(char *Input, char *Output) {
- remove("/home/joshua/Desktop/NovaBot/lazyass.txt");
- // First we need to create a file to feed z80asm
- FILE *MyFile = fopen("/home/joshua/Desktop/NovaBot/lazyass.f","w");
- if(MyFile==NULL) {
- strcpy(Output,"unable to open lazyass.f");
- return;
- }
- char *Peek = Input;
- while(*Peek) {
- fputc(*(Peek++), MyFile);
- }
- // Now we have a file to feed nbfalse
- fclose(MyFile);
- int Status = system("PATH=\"$HOME/bin:$PATH\"");
- //sprintf(Command, "/home/joshua/Desktop/NovaBot/nbfalse lazyass.f > lasyass.txt");
- //Status = system("nbfalse lazyass.f > lazyass.txt");
- Status = system("/home/joshua/Desktop/NovaBot/nbfalse /home/joshua/Desktop/NovaBot/lazyass.f > /home/joshua/Desktop/NovaBot/lazyass.txt");
- // Open the assembled code
- MyFile = fopen("/home/joshua/Desktop/NovaBot/lazyass.txt","rb");
- if(MyFile==NULL) {
- sprintf(Output,"Unable to open lazyass.txt. (%i)", Status);
- return;
- }
- strcpy(Output,"");
- char *Poke = Output;
- // int len=0; // code length
- int ch;
- do {
- ch = fgetc(MyFile);
- if(ch==EOF)
- break;
- if(ch=='\n' || ch=='\r')
- ch = '|';
- *(Poke++) = ch;
- } while(ch != EOF);
- *Poke = 0;
- }
- //"/home/joshua/Desktop/NovaBot/data/"
- static int RequiresArgument(char *ReplyCmd, char *Msg) {
- if(Msg != NULL)
- xchat_commandf(ph, "%s %s", ReplyCmd, Msg);
- else
- xchat_commandf(ph, "%s Hey! You forgot to put something after the command. >_>", ReplyCmd);
- return XCHAT_EAT_ALL;
- }
- // 1 2 3 4 (search for -A and begin from there)
- // NB_ExtCmd replycmd command nick -A arguments
- static int nb_extcmdtest_cb(char *word[], char *word_eol[], void *userdata) {
- if(word[2] == NULL && word[3] == NULL && word[4] == NULL)
- return XCHAT_EAT_NONE; // oops
- char Temp[512];
- char *ReplyCmd = word[2];
- char *NBCmd = word[3];
- char *Nick=word[4];
- int i;
- int ArgPtrIndex = -1;
- char *ArgPtr = NULL;
- for(i=4;i<10 && (word[i]!=NULL);i++) {
- if(!strcasecmp(word[i],"-A"))
- if(word[++i]!=NULL)
- if(strcasecmp(word[i],"")) {
- ArgPtr = word_eol[i];
- ArgPtrIndex = i;
- break;
- }
- }
- if(!strcasecmp(NBCmd,"rot13") && NULL!=ArgPtr) {
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"allcaps") && NULL!=ArgPtr) {
- xchat_commandf(ph, "spark allcaps %s", ArgPtr);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"altcaps") && NULL!=ArgPtr) {
- xchat_commandf(ph, "spark altcaps %s", ArgPtr);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"randcaps") && NULL!=ArgPtr) {
- xchat_commandf(ph, "spark randcaps %s", ArgPtr);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"bouncycaps") && NULL!=ArgPtr) {
- xchat_commandf(ph, "spark bouncycaps %s", ArgPtr);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"rainbow") && NULL!=ArgPtr) {
- xchat_commandf(ph, "spark rainbow %s", ArgPtr);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"rainbow4") && NULL!=ArgPtr) {
- xchat_commandf(ph, "spark rainbow4 %s", ArgPtr);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"rainbowcaps") && NULL!=ArgPtr) {
- xchat_commandf(ph, "spark rainbowcaps %s", ArgPtr);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"hstroll") && NULL!=ArgPtr) {
- xchat_commandf(ph, "spark hstroll %s", ArgPtr);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"echo") && NULL!=ArgPtr) {
- xchat_commandf(ph, "%s %s", ReplyCmd, ArgPtr);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"backwards") && NULL!=ArgPtr) {
- xchat_commandf(ph, "spark backwards %s", ArgPtr);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"strlen") && NULL!=ArgPtr) {
- xchat_commandf(ph, "%s strlen is %i", ReplyCmd, strlen(ArgPtr));
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"datediff") && NULL!=ArgPtr) {
- int Days = abs(ReadDate3(word[i])-ReadDate3(word[i+1])) / 86400;
- xchat_commandf(ph, "%s %i days (%i weeks and %i days)", ReplyCmd, Days, Days/7, Days%7);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"curtime")) {
- time_t rawtime;
- struct tm * timeinfo;
- time (&rawtime);
- timeinfo = localtime(&rawtime);
- strftime(Temp,80,"Now it's %x, %I:%M %p (%Z)",timeinfo);
- xchat_commandf(ph, "%s %s", ReplyCmd, Temp);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"krypto") && NULL!=ArgPtr) {
- char *Get = BruteforceKrypto(strtol(word[i],NULL,10), strtol(word[i+1],NULL,10), strtol(word[i+2],NULL,10), strtol(word[i+3],NULL,10), strtol(word[i+4],NULL,10), strtol(word[i+5],NULL,10), Temp);
- xchat_commandf(ph, "%s %s", ReplyCmd, Get);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"davyiff") && NULL!=ArgPtr) {
- xchat_commandf(ph, "spark davyiff %s", ArgPtr);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"givejuice") && NULL!=ArgPtr) {
- if(strlen(ArgPtr)<50) {
- if(strcasecmp(ArgPtr,"Nova")) {
- xchat_commandf(ph, "me hands %s a cup of %s juice :3", Nick, ArgPtr);
- } else {
- xchat_commandf(ph, "say Why don't you just ask hir for some?",word[1]);
- }
- }
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"ppuaddris") && NULL!=ArgPtr) {
- char tiny[74];
- int Address = strtol(ArgPtr,NULL,16);
- strcpy(Temp,"(I don't know ;-;)");
- if(Address < 0x2000) {
- sprintf(Temp, "CHR tile page %i, number %i/$%x", Address / 0x1000, (Address / 16) & 255, (Address/16)&255);
- int Row = Address % 8;
- int Plane = Address & 8;
- if(Plane != 0)
- strcat(Temp, ", second plane");
- if(Row != 0) {
- sprintf(tiny,", row %i", Row);
- strcat(Temp,tiny);
- }
- }
- else if(Address <= 0x2fff && Address >= 0x2000) { // &&!already
- int tile = Address & 1023;
- if(tile < 0x3c0)
- sprintf(Temp, "Nametable %i, tile %i,%i", (Address-0x2000)/1024, tile&31, (tile/32)&31);
- else {
- sprintf(Temp, "Nametable %i, attribute %i,%i", (Address-0x2000)/1024, (tile & 7), (tile/8)&7);
- }
- }
- if(Address <= 0x301f && Address >= 0x3000) { // &&!already
- sprintf(Temp, "%s palette %i, (color %i in palette)", (Address>=0x3010 ?"sprite":"background"), (Address>>2)&3, Address & 3);
- }
- xchat_commandf(ph, "%s PPU address is: %s", ReplyCmd, Temp);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"abuse")) {
- xchat_commandf(ph, "%s DO NOT ABUSE THE BOT. IF YOU ABUSE THE BOT, PINKIE PIE **WILL** FUCK YOUR SHIT UP! THEN SHE WILL VIOLATE YOU WITH CUPCAKES. TASTY, RAINBOW DASH FLAVOUR CUPCAKES!", ReplyCmd);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"yiffisillegal")) {
- xchat_commandf(ph, "%s Now I'm not horny anymore. Thanks for ruining it, %s! >:(", ReplyCmd, Nick);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"help")) {
- xchat_commandf(ph, "%s Check http://www.smwiki.net/wiki/NovaBot", ReplyCmd);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"myiff")) {
- NBCmd = "pyiff";
- ArgPtr = Nick;
- }
- if(!strcasecmp(NBCmd,"syiff")) {
- NBCmd = "pyiff";
- ArgPtr = "NovaBot";
- }
- if((!strcasecmp(NBCmd,"pyiff")||!strcasecmp(NBCmd,"yiff")) && NULL!=ArgPtr) {
- xchat_commandf(ph, "YIFF %s", ArgPtr);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"zas") && NULL!=ArgPtr) {
- char Lower[512];
- int i=0;
- for(i=0;;) {
- Lower[i]=tolower(ArgPtr[i]);
- if(0==ArgPtr[i++])
- break;
- }
- if(strlen(ArgPtr) > 150)
- xchat_commandf(ph,"%s Too many chars of ASM given",ReplyCmd);
- else if(strstr(Lower, "incbin"))
- xchat_commandf(ph,"%s incbin disabled to avoid crashes",ReplyCmd);
- else if(strstr(Lower, "include"))
- xchat_commandf(ph,"%s include disabled to avoid crashes",ReplyCmd);
- else {
- char Hex[2048];
- z80Asm(ArgPtr,Hex);
- if(strlen(Hex)>400) {
- xchat_commandf(ph, "%s Assembled program is too many chars to read out",ReplyCmd);
- }
- else
- xchat_commandf(ph, "%s %s",ReplyCmd, Hex);
- }
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"false") && NULL!=ArgPtr) {
- if(strlen(ArgPtr) > 150)
- xchat_commandf(ph,"%s Too many chars given",ReplyCmd);
- else {
- char Hex[2048];
- NBFalse(ArgPtr,Hex);
- if(strlen(Hex)>400) {
- xchat_commandf(ph, "%s Output is too many chars",ReplyCmd);
- }
- else
- xchat_commandf(ph, "%s %s",ReplyCmd, Hex);
- }
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"rand") && NULL!=ArgPtr) {
- int max = strtol(ArgPtr, NULL, 10);
- if(max != 0)
- xchat_commandf(ph, "%s Here's your random number (modulo %i, +1): %i",ReplyCmd,max,1+rand()%max);
- else
- xchat_commandf(ph, "%s I'm not going to divide by zero, sorry",ReplyCmd);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"rand")) {
- sprintf(Temp,"%s Here's your random number: %i",ReplyCmd,rand());
- xchat_command(ph, Temp);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"dice") && NULL!=ArgPtr) {
- int dice = strtol(ArgPtr, &ArgPtr, 10);
- if(NULL != ArgPtr) {
- int sides = strtol(ArgPtr, &ArgPtr, 10);
- int total = 0;
- int num;
- if(dice > 300)
- xchat_commandf(ph, "%s I know better than to lag myself trying to roll that many", ReplyCmd);
- else if (sides == 0)
- xchat_commandf(ph, "%s I don't have any dice with zero sides", ReplyCmd);
- else if (dice < 1)
- xchat_commandf(ph, "%s I can't roll a negative number of dice", ReplyCmd);
- else {
- for(num = 0; num < dice; num++)
- total+=1+(rand()*sides/RAND_MAX);
- char *DiceWord = "dice";
- if(sides == 2) DiceWord = "coins";
- if(sides == 1) DiceWord = "spheres";
- if(sides < 0) DiceWord = "negative dice";
- xchat_commandf(ph, "%s I %s %i %s, each with %i sides and got: %i",ReplyCmd,(sides!=2?"rolled":"flipped"),dice,DiceWord, sides, total);
- }
- }
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"zmulbyadd") && NULL!=ArgPtr) {
- z80FakeMultiply(Temp, strtol(ArgPtr,NULL,10));
- xchat_commandf(ph, "%s List: %s", ReplyCmd, Temp);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"clean") && NULL!=ArgPtr) {
- xchat_commandf(ph, "me produces a hose and sprays down %s", ArgPtr); //Message+9);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"convbase") && NULL!=ArgPtr) {
- int whatever;
- switch(*ArgPtr) {
- case '$':
- whatever = strtol(ArgPtr+1,NULL,16);
- break;
- case '%':
- whatever = strtol(ArgPtr+1,NULL,2);
- break;
- default:
- whatever = strtol(ArgPtr,NULL,10);
- break;
- }
- xchat_commandf(ph, "%s %i == $%x",ReplyCmd,whatever, whatever);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"calc") && NULL!=ArgPtr) {
- if(!strcasecmp(ArgPtr, "tragedy time +") || !strcasecmp(ArgPtr, "time tragedy +")) {
- xchat_commandf(ph,"%s calc: comedy", ReplyCmd);
- return XCHAT_EAT_ALL;
- }
- if(strlen(ArgPtr) > 100) {
- xchat_commandf(ph,"%s Equation's too long",ReplyCmd);
- return XCHAT_EAT_ALL;
- }
- else {
- InfoQuit Test = RunRetardScript(ArgPtr,0,1);
- if(strlen(Test.Text) < 400)
- xchat_commandf(ph, "%s calc: %s", ReplyCmd, Test.Text);
- else
- xchat_commandf(ph, "%s calc - too much on the stack to display (%i chars)", ReplyCmd, Test.Text, strlen(Test.Text));
- }
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"jumpengine")) {
- xchat_commandf(ph, "%s asl \\ tay \\ pla \\ sta 4 \\ pla \\ sta 5 \\ iny \\ lda (4),y \\ sta 6 \\ iny \\ lda (4),y \\ sta 7 \\ jmp (6)", ReplyCmd);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"beep")) {
- xchat_commandf(ph, "%s beep! \a",ReplyCmd);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"wtf")) {
- xchat_commandf(ph, "%s Don't worry about it, go back to bed",ReplyCmd);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"getmeasoda")) {
- xchat_commandf(ph, "me hands %s a soda",Nick);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"getmeafuckingsoda")) {
- xchat_commandf(ph, "me hands %s a soda which then fucks %s really hard",Nick, Nick);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd,"getmeasexysoda")) {
- xchat_commandf(ph, "me hands %s a soda which then has sex with %s", Nick, Nick);
- return XCHAT_EAT_ALL;
- }
- if(!strcasecmp(NBCmd, "allcaps") || !strcasecmp(NBCmd, "altcaps") ||
- !strcasecmp(NBCmd, "bouncycaps") || !strcasecmp(NBCmd, "rainbow") ||
- !strcasecmp(NBCmd, "rainbow4") || !strcasecmp(NBCmd, "rainbowcaps") ||
- !strcasecmp(NBCmd, "echo") || !strcasecmp(NBCmd, "backwards") ||
- !strcasecmp(NBCmd, "strlen") || !strcasecmp(NBCmd, "clean") ||
- !strcasecmp(NBCmd, "calc") || !strcasecmp(NBCmd, "convbase") ||
- !strcasecmp(NBCmd, "strlen") || !strcasecmp(NBCmd, "clean") ||
- !strcasecmp(NBCmd, "givejuice") || !strcasecmp(NBCmd, "zmulbyadd") ||
- !strcasecmp(NBCmd, "ppuaddris") || !strcasecmp(NBCmd, "randcaps") ||
- !strcasecmp(NBCmd, "zas") || !strcasecmp(NBCmd, "false") ||
- !strcasecmp(NBCmd, "hstroll") || !strcasecmp(NBCmd, "dice") ||
- !strcasecmp(NBCmd, "yiff") || !strcasecmp(NBCmd, "davyiff") ||
- !strcasecmp(NBCmd, "krypto") || !strcasecmp(NBCmd, "datediff"))
- return RequiresArgument(ReplyCmd, NULL);
- return XCHAT_EAT_NONE; // let other plugins see it
- }
- void xchat_plugin_get_info(char **name, char **desc, char **version, void **reserved) {
- *name = PNAME;
- *desc = PDESC;
- *version = PVERSION;
- }
- int xchat_plugin_deinit() {
- return 1;
- }
- int xchat_plugin_init(xchat_plugin *plugin_handle,
- char **plugin_name,
- char **plugin_desc,
- char **plugin_version,
- char *arg) {
- /* we need to save this for use with any xchat_* functions */
- ph = plugin_handle;
- /* tell xchat our info */
- *plugin_name = PNAME; *plugin_desc = PDESC; *plugin_version = PVERSION;
- xchat_hook_command(ph, "NB_ExtCmd", XCHAT_PRI_NORM, nb_extcmdtest_cb, NULL, 0);
- return 1; /* return 1 for success */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement