Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.87 KB | None | 0 0
  1.  #include <stdio.h>
  2.     #include <unistd.h>
  3.     #include <string.h>
  4.     #include <netdb.h>
  5.     #include <stdarg.h>
  6.     #include <ctype.h>
  7.     #include <stdlib.h>
  8.     #include <netinet/in.h>
  9.     #include <sys/queue.h>
  10.     #include <pthread.h>
  11.     #include <dlfcn.h>
  12.      
  13.     struct exchange
  14.     {
  15.       int running;
  16.       void (*irc_raw)(char *, ...);
  17.       void (*irc_say)(char *, ...);
  18.     };
  19.      
  20.     void
  21.     plugin_get(struct exchange *e, char *buf)
  22.     {
  23.       int index=0, i;
  24.            
  25.       if(!e || !buf)
  26.         return;
  27.      
  28.      
  29.      
  30.      
  31.       if(strstr(buf, "rateit")==buf&&(strstr(buf, "http")==buf+7||strstr(buf, "www.")==buf+7))
  32.         {
  33.           for(i=0; i<strlen(buf); ++i)
  34.             index+=buf[i];
  35.           index+=time(NULL);
  36.      
  37.           srand(index);
  38.  
  39.        
  40.             e->irc_say(rand()%100+"");
  41.         }
  42.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement