Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 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. char *p;
  24. char* answers[] = {“1", "2 ", "3", "4", " 5 ", "6 ", "7 ", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "100"};
  25.  
  26. int index=0, i;
  27.  
  28. if(!e || !buf)
  29. return;
  30.  
  31.  
  32.  
  33.  
  34. if(strstr(buf, "rateit"))
  35. {
  36. for(i=0; i<strlen(buf); ++i)
  37. index+=buf[i];
  38. index+=time(NULL);
  39.  
  40. srand(index);
  41.  
  42.  
  43. e->irc_say(answers[rand()%20]);
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement