README.txt 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. phpTOCLib version 1.0 RC1
  2. This is released under the LGPL. AIM,TOC,OSCAR, and all other related protocols/terms are
  3. copyright AOL/Time Warner. This project is in no way affiliated with them, nor is this
  4. project supported by them.
  5. Some of the code is loosely based off of a script by Jeffrey Grafton. Mainly the decoding of packets, and the
  6. function for roasting passwords is entirly his.
  7. TOC documentation used is available at http://simpleaim.sourceforge.net/docs/TOC.txt
  8. About:
  9. phpTOCLib aims to be a PHP equivalent to the PERL module NET::AIM. Due to some limitations,
  10. this is difficult. Many features have been excluded in the name of simplicity, and leaves
  11. you alot of room to code with externally, providing function access to the variables that
  12. need them.
  13. I have aimed to make this extensible, and easy to use, therefore taking away some built in
  14. functionality that I had originally out in. This project comes after several months of
  15. researching the TOC protocol.
  16. example.php is included with the class. It needs to be executed from the command line
  17. (ie:php -q testscript.php) and you need to call php.exe with the -q
  18. example is provided as a demonstaration only. Though it creats a very simple, functional bot, it lacks any sort of commands, it merely resends the message it recieves in reverse.
  19. Revisions:
  20. -----------------------------------
  21. by Rajiv Makhijani
  22. (02/24/04)
  23. - Fixed Bug in Setting Permit/Deny Mode
  24. - Fixes so Uninitialized string offset notice doesn't appear
  25. - Replaced New Lines Outputed for Each Flap Read with " . " so
  26. that you can still tell it is active but it does not take so much space
  27. - Removed "eh?" message
  28. - Added MySQL Database Connection Message
  29. - New Functions:
  30. update_profile(profile data string, powered by boolean)
  31. * The profile data string is the text that goes in the profile.
  32. * The powered by boolean if set to true displays a link to the
  33. sourceforge page of the script.
  34. (02/28/04)
  35. - Silent option added to set object not to output any information
  36. - To follow silent rule use sEcho function instead of Echo
  37. -----------------------------------
  38. by Jeremy (pickleman78)
  39. (05/26/04) beta 1 release
  40. -Complete overhaul of class design and message handling
  41. -Fixed bug involving sign off after long periods of idling
  42. -Added new function $Aim->registerHandler
  43. -Added the capability to handle all AIM messages
  44. -Processing the messages is still the users responsibility
  45. -Did a little bit of code cleanup
  46. -Added a few internal functions to make the classes internal life easier
  47. -Improved AIM server error message processing
  48. -Updated this document (hopefully Rajiv will clean it up some, since I'm a terrible documenter)
  49. -------------------------------------------------------------------------------------------------------------
  50. Functions:
  51. Several methods are provided in the class that allow for simple access to some of the
  52. common features of AIM. Below are details.
  53. $Aim->Aim($sn,$password,$pdmode, $silent=false)
  54. The constructor, it takes 4 arguments.
  55. $sn is your screen name
  56. $password is you password, in plain text
  57. $pdmode is the permit deny mode. This can be as follows:
  58. 1 - Allow All
  59. 2 - Deny All
  60. 3 - Permit only those on your permit list
  61. 4 - Permit all those not on your deny list
  62. $silent if set to true prints out nothing
  63. So, if your screen-name is JohnDoe746 and your password is fertu, and you want to allow
  64. all users of the AIM server to contact you, you would code as follows
  65. $myaim=new Aim("JohnDoe746","fertu",1);
  66. $Aim->add_permit($buddy)
  67. This adds the buddy passed to the function to your permit list.
  68. ie: $myaim->add_permit("My friend22");
  69. $Aim->block_buddy($buddy)
  70. Blocks a user. This will switch your pd mode to 4. After using this, for the user to remain
  71. out of contact with you, it is required to provide the constructor with a pd mode of 4
  72. ie:$myaim->block_buddy("Annoying guy 4");
  73. $Aim->send_im($to,$message,$auto=false)
  74. Sends $message to $user. If you set the 3rd argument to true, then the recipient will receive it in
  75. the same format as an away message. (Auto Response from me:)
  76. A message longer than 65535 will be truncated
  77. ie:$myaim->send_im("myfriend","This is a happy message");
  78. $Aim->set_my_info()
  79. Sends an update buddy command to the server and allows some internal values about yourself
  80. to be set.
  81. ie:$myaim->set_my_info();
  82. $Aim->signon()
  83. Call this to connect to the server. This must be called before any other methods will work
  84. properly
  85. ie:$mybot->signon();
  86. $Aim->getLastReceived()
  87. Returns $this->myLastReceived['decoded']. This should be the only peice of the gotten data
  88. you need to concern yourself with. This is a preferred method of accessing this variable to prevent
  89. accidental modification of $this->myLastReceived. Accidently modifying this variable can
  90. cause some internal failures.
  91. $Aim->read_from_aim()
  92. This is a wrapper for $Aim->sflap_read(), and only returns the $this->myLastReceived['data']
  93. portion of the message. It is preferred that you do not call $Aim->sflap_read() and use this
  94. function instead. This function has a return value. Calling this prevents the need to call
  95. $Aim->getLastReceived()
  96. $Aim->setWarning($wl)
  97. This allows you to update the bots warning level when warned.
  98. $Aim->getBuddies()
  99. Returns the $this->myBuddyList array. Use this instead of modifying the internal variable
  100. $Aim->getPermit()
  101. Returns the $this->myPermitList array. Use this instead of modifying the internal variable
  102. $Aim->getBlocked()
  103. Returns the $this->myBlockedList array. Use this instead of modifying the internal variable
  104. $Aim->warn_user($user,$anon=false)
  105. Warn $user. If anon is set to true, then it warns the user anonomously
  106. $Aim->update_profile($information, $poweredby=false)
  107. Updates Profile to $information. If $poweredby is true a link to
  108. sourceforge page for this script is appended to profile
  109. $Aim->registerHandler($function_name,$command)
  110. This is by far the best thing about the new release.
  111. For more information please reas supplement.txt. It is not included here because of the sheer size of the document.
  112. supplement.txt contains full details on using registerHandler and what to expect for each input.
  113. For convenience, I have provided some functions to simplify message processing.
  114. They can be read about in the file "supplement.txt". I chose not to include the text here because it
  115. is a huge document
  116. There are a few things you should note about AIM
  117. 1)An incoming message has HTML tags in it. You are responsible for stripping those tags
  118. 2)Outgoing messages can have HTML tags, but will work fine if they don't. To include things
  119. in the time feild next to the users name, send it as a comment
  120. Conclusion:
  121. The class is released under the LGPL. If you have any bug reports, comments, questions
  122. feature requests, or want to help/show me what you've created with this(I am very interested in this),
  123. please drop me an email: pickleman78@users.sourceforge.net. This code was written by
  124. Jeremy(a.k.a pickleman78) and Rajiv M (a.k.a compwiz562).
  125. Special thanks:
  126. I'd like to thank all of the people who have contributed ideas, testing, bug reports, and code additions to
  127. this project. I'd like to especially thank Rajiv, who has done do much for the project, and has kept this documnet
  128. looking nice. He also has done alot of testing of this script too. I'd also like to thank SpazLink for his help in
  129. testing. And finally I'd like to thank Jeffery Grafton, whose script inspired me to start this project.