Ford

Eggdrop Connect

Nov 5th, 2011
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.12 KB | None | 0 0
  1. ;EggDrop Connect by Ford_Lawmower irc.geekshed.net #Script-Help
  2. ;;Edit EggColor1 to change the nick color, your text and Emphesis text color.
  3. alias -l EggColor1 return $+($chr(3),04)
  4. ;;Edit EggColor2 to change the primary response text.
  5. alias -l EggColor2 return $+($chr(3),03)
  6. ;;Edit EggDivider to change the between the EggNick and the response text.
  7. alias -l EggDivider return $+($chr(2),$EggColor1,»»,$chr(15))
  8. menu channel,status,menubar,@EggDropConnect* {
  9. .EggDrop Connect:EggDropConnect
  10. }
  11. menu @EggDropConnect* {
  12. .$iif($EggIsConnect,$v1,Disconnected)
  13. .$iif($EggIsConnect,$style(2)) Connect:{
  14. sockopen $EggSockName $EggIP $EggPort
  15. EggMsg Connecting to Eggdrop.. Please Wait.....
  16. EggMsg Remember you must enter your username and password when prompted.
  17. }
  18. .$iif(!$EggNick,$style(2)) Disconnect:{
  19. EggMsg Disconnecting
  20. EggMsg Bye Bye :)
  21. sockclose $EggSockName
  22. EggMsg Disconnected
  23. }
  24. }
  25. alias -l EggIsConnect return $sock($EggSockName)
  26. alias -l EggMsg echo $active $iif($EggNick,$+(<,$EggColor1,$v1,$chr(15),>),$+($EggColor1,EggConnect)) $EggDivider $+($EggColor2,$1-)
  27. alias -l EggNick return $gettok($sock($EggSockName).mark,3,32)
  28. alias -l EggSockName return $mid($active,2-)
  29. alias -l EggIP return $gettok($mid($EggSockName,15-),1,58)
  30. alias -l EggPort return $gettok($gettok($mid($EggSockName,15-),2,58),1,45)
  31. dialog EggDropConnect {
  32. title "EggDrop Connect"
  33. size -1 -1 105 101
  34. option dbu
  35. text "IP Address:", 1, 4 10 37 8, right
  36. text "Port:", 2, 4 22 37 8, right
  37. text "Handle:", 3, 5 34 37 8, right
  38. text "Password:", 4, 5 47 37 8, right
  39. edit "", 5, 45 9 55 10, autohs
  40. edit "", 6, 45 21 55 10, autohs
  41. edit "", 7, 45 33 55 10, autohs
  42. edit "", 8, 45 46 55 10, pass autohs
  43. text "", 9, 4 62 97 13
  44. button "Connect", 10, 5 82 37 12
  45. button "Close", 11, 64 82 37 12, cancel
  46. }
  47. alias -l EggDropConnect dialog $iif($dialog(EggDropConnect),-v,-m) EggDropConnect EggDropConnect
  48. On *:dialog:EggDropConnect:Sclick:10: {
  49. tokenize 32 $did($dname,5) $did($dname,6) $did($dname,7) $did($dname,8)
  50. if ($numtok($1-,32) < 4) {
  51. did -a $dname 9 Please fill in all the boxes and try again.
  52. .timereggcomment 1 4 did -a $dname 9
  53. }
  54. elseif (!$regex($1,(?:[\d]{1,3})\x2E(?:[\d]{1,3})\x2E(?:[\d]{1,3})\x2E(?:[\d]{1,3}))) {
  55. did -a $dname 9 IP Address must be in the form of xx.xx.xx.xx Check it and try again.
  56. .timereggcomment 1 4 did -a $dname 9
  57. }
  58. elseif ($2 !isnum) {
  59. did -a $dname 9 Port must be a number. Check it and try again.
  60. .timereggcomment 1 4 did -a $dname 9
  61. }
  62. elseif ($numtok($1-,32) > 4) {
  63. did -a $dname 9 Unknown error in one of the fields. Please review them and try again.
  64. .timereggcomment 1 4 did -a $dname 9
  65. }
  66. else { eggconnect $1- }
  67. }
  68. alias eggconnect {
  69. var %sockname $+(EggDropConnect,$1,:,$2,-,TO,-,$3)
  70. if ($sock(%sockname)) sockclose %sockname
  71. sockopen %sockname $1 $2
  72. sockmark %sockname $3 $4
  73. if (!$window($+(@,%sockname))) { window -e $+(@,%sockname) }
  74. echo $+(@,%sockname) Connecting to your Eggdrop. Please Wait.......
  75. }
  76. on *:sockopen:EggDropConnect*: {
  77. if ($sockerr) {
  78. eggecho Socket Error Cannot Connect...
  79. eggecho No one seems to be listening on $mid($gettok($sockname,1,45),15-)
  80. eggecho Check your IP Address / Port Settings and Try Again.
  81. sockclose $sockname
  82. }
  83. elseif ($gettok($sock($sockname).mark,1,32)) {
  84. sockwrite -nt $sockname $v1
  85. if ($gettok($sock($sockname).mark,2,32)) { .timer 1 2 sockwrite -nt $sockname $v1 }
  86. }
  87. }
  88. on *:sockread:EggDropConnect*: {
  89. var %eggconnect | sockread %eggconnect
  90. if (%eggconnect) {
  91. eggdispformat $+(@,$sockname) $iif($gettok($sock($sockname).mark,3,32),$+(<,$EggColor1,$v1,$chr(15),>),$+($EggColor1,EggConnect)) $EggDivider %eggconnect
  92. if ($regex(%eggconnect,/Connected to (.*)\x2C running eggdrop/i)) sockmark $sockname 1 1 $regml(1)
  93. elseif (%eggconnect == You don't have access.) {
  94. eggecho $+($EggColor1,EggConnect) $+($EggDivider,$EggColor2) It appears that the eggdrop doesn't know you by $&
  95. $+(",$iif($gettok($sock($sockname).mark,1,32),$v1,that name),")
  96. eggecho $+($EggColor1,EggConnect) $+($EggDivider,$EggColor2) Please Try again with the Name that the bot knows you by.
  97. sockclose $sockname
  98. }
  99. elseif (Negative on that isin %eggconnect) {
  100. eggecho $+($EggColor1,EggConnect) $+($EggDivider,$EggColor2) It appears that the password you entered is incorrect.
  101. eggecho $+($EggColor1,EggConnect) $+($EggDivider,$EggColor2) Please try again with the correct password.
  102. sockclose $sockname
  103. }
  104. }
  105. }
  106. alias -l eggecho echo $+(@,$sockname) $+($EggColor2,$1-)
  107. alias -l eggsend {
  108. sockwrite -nt $iif($sockname,$v1 $1-,$1-)
  109. echo $+(@,$iif($sockname,$v1 $me $EggDivider $+($EggColor1,$1-),$1 $+(<,$EggColor1,$me,$chr(15),>) $EggDivider $+($EggColor1,$2-)))
  110. }
  111. alias -l eggdispformat { echo $1-3 $remove($+($EggColor2,$replace($4-,,$+($chr(15),[,$EggColor1),,$+($chr(15),],$EggColor2))),ÿû,ÿü) }
  112. On *:input:@EggdropConnect*: { if ($left($1,1) != /) && ($EggIsConnect) eggsend $v1 $1- }
  113. On *:close:@EggdropConnect*: { sockclose $mid($target,2-) }
Advertisement
Add Comment
Please, Sign In to add comment