PDA

View Full Version : [Request] IRC requests


InNeedof
01-04-2005, 03:06 PM
Ok I know the first thing thats gonna be said is look in the forums, I have done this and TBH im still lost

using latest versions of IO / IOA / IOB

just cant figure out how to get the IRC request commands to function...

the !requests calls to the ftp and displays the requests, but u cant Add or Fill requests Via IRC, just need a lil help in the right direction to sort the problem out..... which info do I need to paste here to help see the prob ??

edit, still playin

[Request]
Request_Header = "-[Request]----------------------------------------------------------------------"
Request_Footer = "--------------------------------------------------------------------------[ioA]-"
Request_File = "e:\ioFTPD\site\request\.ioFTPD.message"
Request_Line = " [%##] [%-10user] -> %request"
Request_Field = " -> "
Request_Max = 3
Request_Max_User = 4
Request_Excluded_User_0 = "sitebot"
Request_Too_Many_Made = " Too many requests made. Limit is %.0request"
Request_Too_Many_Made_User = " You have made too many requests already. Limit is %.0request"
Request_Already_Made = " That is already requested"
Request_Output_Line = " Added request: %request"
Request_Log = ""%user" "%group" "%request""
Request_Add_Tag = 1
Request_Tag = "[REQ]-%request"
Request_IRC_Uid = 104
Request_IRC_Gid = 1



sitebot nick is sitebot But on irc eggdrop is Britney(dont laugh) would that make a difference ?

Bobby_Digital
01-05-2005, 07:23 AM
I think u have to be +o on the eggdrop inorder to add/delete/fill requests. So try to add +o to your nick in eggdrop and see if that works.

Good luck!

/Bobby_Digital

InNeedof
01-05-2005, 08:51 AM
tried it , hasnt made any difference

.chattr <hand> +o <#channel>

set that to irc nick and channel

.chattr ****** +o #*****


nothing changed.... and still trying :) , thx for the reply

jboy53
01-05-2005, 12:47 PM
does this file exist?

Request_File = "e:\ioFTPD\site\request\.ioFTPD.message"

InNeedof
01-05-2005, 03:34 PM
Originally posted by jboy53
does this file exist?

Request_File = "e:\ioFTPD\site\request\.ioFTPD.message"

nice thought.. even thought it was the problem.. as my requests folder root is actually

D:\requests

so I added the message file to it and redid the path,

Request_File = "D:\requests\.ioFTPD.message"


unfortunately its still the same

jboy53
01-05-2005, 04:11 PM
does site REQUEST whatever work?

just to rule out an ioA problem

InNeedof
01-05-2005, 04:16 PM
Originally posted by jboy53
does site REQUEST whatever work?

just to rule out an ioA problem


yeah works gr8 and displays the newly added request in channel.. and on site when u set as filled, also displays in channel from site..

just the adding of request from irc ...

jboy53
01-05-2005, 04:39 PM
I haven't used ioB for a while... but...

it appears that out of the box ioBanana does not use this !reqfilled and so on and if memory serves me right (now its all coming back to me) this was down to security reasons.

there is a fix that possibly done but im not sure how one would really go about it...

I prepare to be shot down by harm if I am wrong about the out of the box comment.. harm I apologise in advance.

perhaps this could be a request script section or somebody may pm you or paste how it "could" be done in ioB

InNeedof
01-07-2005, 09:32 AM
ok cheers.. ill keep checking back to see if theres any updates on this :)

Harm
01-08-2005, 02:20 AM
jboy53: You are absolutely right, there's no such command in ioBanana v20.

No that this couldn't be easily added (and secured via +o or the trusted hostmasks) but ...
1) you wouldn't be the requester shown by ioA.
2) as a consequence you wouldn't receive any message about the request being filled.

That is for !reqadd but it's the same for !reqfilled.

Harm
02-06-2005, 03:30 AM
The best solution I can come up with at the moment is to add "-%ircnick" to the requested dir on !reqadd.
I don't consider this as a really nice solution and will most probably disable those command by default. If you really want something, you can at least login :p They will most probably be available in ioB2 anyway (but disabled as I said) since they don't really eat cpu or bw.

WarC: There's an option to specify nuker username and group on NUKE, what about the same one on REQUEST ? I know irc nicknames aren't the sames as usernames ; I would use usernames on the bot, not in channel.

EwarWoo
02-06-2005, 03:48 AM
1 solution is to specify who the request is for in the command, and if they supply an invalid username (or none at all) it can just reject it with reason

Harm
02-06-2005, 01:58 PM
Using the trusted hosts (already there) or the bot's own userlist is faster and a bit more secure.

Threepw00d
03-06-2005, 10:34 PM
Since I can't wait for HaRM to add iRC request to ioB2, I decided to write a little iRC request script myself. Its a bit rudimentary, I haven't spent much time refining/testing it so please forgive my lack of coding panache! :P

1. You need to be using latest versions of ioFTPD/ioB/ioA

2. in ioftpd.ini, under [FTP_Custom_Commands] section add:

################################################## #############################
# Additional custom commands to enable IRC requesting
reqirc = EXEC ..\scripts\ioA\ioA.exe REQUESTIRC
reqdelirc = EXEC ..\scripts\ioA\ioA.exe REQDELIRC
reqfilledirc = EXEC ..\scripts\ioA\ioA.exe REQFILLEDIRC
################################################## #############################

3.1 in iobanana.tcl, add the following binds in BINDS section:

################################################## #############################
# Additional Binds to enable IRC requesting
bind pub - $ioBvar(cmdpre)request proc_irc_request
bind pub - $ioBvar(cmdpre)reqdel proc_irc_reqdel
bind pub - $ioBvar(cmdpre)reqfilled proc_irc_reqfilled
################################################## #############################


3.2 in iobanana.tcl, add the following procs at the end:

################################################## ##############################
# Additional procs to enable IRC requesting
proc proc_irc_request {nick uhost hand chan args} {
global ioBvar
{if {[ioB:istrusted $uhost]} {
set nicksplit [split $nick {}]
set count 0
foreach alpha $nicksplit {
if {[string equal $alpha "\\"] || [string equal $alpha "\|"] } {
set nicksplit [lreplace $nicksplit $count $count]
incr count -1
}
incr count
}
set nick [join $nicksplit {}]
set arg [join [list $args "$nick@iRC"] "-"]
set status [catch {set ee [::ftp::Quote $ioBvar(ftp) SITE REQIRC $arg]} result]
if { $status == 0 } {
set output "-:[b]:[b] [c]$ioBvar(color1)request[c] [b]:[b]:- [b]\[REQ\]-%request[b] added by [b]%name[b]" ;
set output [ioB:replacevar $output "%name" $nick]
set output [ioB:replacevar $output "%request" $args]
set output [ioB:basicreplace $output "REQUEST"]
ioB:tsend chan $chan $output
}
}
}

proc proc_irc_reqdel {nick uhost hand chan args} {
global ioBvar
{if {[ioB:istrusted $uhost]} {
set arg [lindex $args 0]
if { [string is digit -strict $arg] } {
set status [catch {set ee [::ftp::Quote $ioBvar(ftp) SITE REQDELIRC $arg]} result]
set lines [split $ee \n]
set lines [lreplace $lines 0 0]
set lines [lreplace $lines end end]
set lines [lreplace $lines end end]
if { $status == 0 } {
if { [string equal [lindex $lines 0] "200- Request not found"] } {
set output "-:[b]:[b] [c]$ioBvar(color1)error[c] [b]:[b]:- Request number [b]$arg[b] not found: check !requests for correct request number"
ioB:tsend chan $chan $output
} else {
set output "-:[b]:[b] [c]$ioBvar(color1)request deleted[c] [b]:[b]:- request [b]%request[b] deleted by [b]%user[b]@iRC"
set output [ioB:replacevar $output "%user" $nick]
set output [ioB:replacevar $output "%request" $arg]
ioB:tsend chan $chan $output
}
}
} else {
set output "-:[b]:[b] [c]$ioBvar(color1)error[c] [b]:[b]:- Request number not found: $arg is not a number"
ioB:tsend chan $chan $output
}
}
}

proc proc_irc_reqfilled {nick uhost hand chan args} {
global ioBvar
set arg [lindex $args 0]
if { [string is digit -strict $arg] } {
set status [catch {set ee [::ftp::Quote $ioBvar(ftp) SITE REQFILLEDIRC $arg]} result]
set lines [split $ee \n]
set lines [lreplace $lines 0 0]
set lines [lreplace $lines end end]
set lines [lreplace $lines end end]
if { $status == 0 } {
if { [string equal [lindex $lines 0] "200- Request not found"] } {
set output "-:[b]:[b] [c]$ioBvar(color1)error[c] [b]:[b]:- Request number [b]$arg[b] not found: check !requests for correct request number"
ioB:tsend chan $chan $output
} else {
set lines [split [lindex $lines 0] :]
set reqfilled [string trim [lindex $lines 1]]
set output "-:[b]:[b] [c]$ioBvar(color1)filled request[c] [b]:[b]:- [b]\[%request\][b] > [b]\[REQ\]-%reqfilled[b] filled by [b]%user[b]@iRC"
set output [ioB:replacevar $output "%user" $nick]
set output [ioB:replacevar $output "%request" $arg]
set output [ioB:replacevar $output "%reqfilled" $reqfilled]
ioB:tsend chan $chan $output
}
}
} else {
set output "-:[b]:[b] [c]$ioBvar(color1)error[c] [b]:[b]:- Request number not found: $arg is not a number"
ioB:tsend chan $chan $output
}
}
################################################## ##############################

4. Add a user iRC/iRC, or even sitebot/sitebot will do (something to let you know that request was made from iRC). Then put that uID and gID into Request_IRC_Uid and Request_IRC_Gid in ioA.cfg. uID and gID is in \etc\UserIdTable and \etc\GroupIdTable.

5. this assumes that you are using ioB_colors.skin to display output. if you don't want colors remove [c]$ioBvar(color1) and the other [c] wherever you see it.

6. rehash (or restart) your bot, rehash site config (or restart ioFTPD).

7. test to make sure everything works as it should. add users to trusted list if you haven't already. only those users can !request or !reqdel who have been added in ioBanana.tcl in set ioBvar(trusted) {ident1@ip1 ident2@ip2}. All users can reqfill.

Features:

*Trusted users can make request in chan with !request <rls.name-grp>
*Request will be added as [REQ]-rls.name-grp-iRCNick@iRC. It shouldn't be too hard to customize that to your taste.
*Trusted users can delete request (which hasn't been !reqfilled) in chan with !reqdel <req number> (use !requests to check the rls. number)
*Users with pipe (|) or (\) in iRC nickname will have that character ripped off because Windows file system doesn't allow directories with those chars. So if someone has nickname |||\\\||| his name won't show up. Request made by |SpankMe| will look like [REQ]-rls.name-grp-SpankMe@iRC
*Everyone in chan can do !reqfilled <req number>
*Report bugs and suggestions here. I'll check back from time to time or the other accomplished coders can help you out too. ;)

Master Sammy
03-09-2005, 08:27 AM
Does not go with me unfortunately

ioFTPD-Noop
03-16-2005, 03:10 AM
proc proc_irc_request {nick uhost hand chan args} {
global ioBvar
{if {[ioB:istrusted $uhost]} {
set nicksplit [split $nick {}]
set count 0
foreach alpha $nicksplit {
if {[string equal $alpha "\\"] || [string equal $alpha "\|"] } {
set nicksplit [lreplace $nicksplit $count $count]
incr count -1
}
incr count
}
set nick [join $nicksplit {}]
set arg [join [list $args "$nick@iRC"] "-"]
set status [catch {set ee [::ftp::Quote $ioBvar(ftp) SITE REQIRC $arg]} result]
if { $status == 0 } {
set output "-:[b]:[b] [c]$ioBvar(color1)request[c] [b]:[b]:- [b]\[REQ\]-%request[b] added by [b]%name[b]" ;
set output [ioB:replacevar $output "%name" $nick]
set output [ioB:replacevar $output "%request" $args]
set output [ioB:basicreplace $output "REQUEST"]
ioB:tsend chan $chan $output
}
}
}

does not go (nothing goes more!bw!help nix)

proc proc_irc_reqdel {nick uhost hand chan args} {
global ioBvar
{if {[ioB:istrusted $uhost]} {
set arg [lindex $args 0]
if { [string is digit -strict $arg] } {
set status [catch {set ee [::ftp::Quote $ioBvar(ftp) SITE REQDELIRC $arg]} result]
set lines [split $ee \n]
set lines [lreplace $lines 0 0]
set lines [lreplace $lines end end]
set lines [lreplace $lines end end]
if { $status == 0 } {
if { [string equal [lindex $lines 0] "200- Request not found"] } {
set output "-:[b]:[b] [c]$ioBvar(color1)error[c] [b]:[b]:- Request number [b]$arg[b] not found: check !requests for correct request number"
ioB:tsend chan $chan $output
} else {
set output "-:[b]:[b] [c]$ioBvar(color1)request deleted[c] [b]:[b]:- request [b]%request[b] deleted by [b]%user[b]@iRC"
set output [ioB:replacevar $output "%user" $nick]
set output [ioB:replacevar $output "%request" $arg]
ioB:tsend chan $chan $output
}
}
} else {
set output "-:[b]:[b] [c]$ioBvar(color1)error[c] [b]:[b]:- Request number not found: $arg is not a number"
ioB:tsend chan $chan $output
}
}
}

does not go (nothing goes more!bw!help nix)
proc proc_irc_reqfilled {nick uhost hand chan args} {
global ioBvar
set arg [lindex $args 0]
if { [string is digit -strict $arg] } {
set status [catch {set ee [::ftp::Quote $ioBvar(ftp) SITE REQFILLEDIRC $arg]} result]
set lines [split $ee \n]
set lines [lreplace $lines 0 0]
set lines [lreplace $lines end end]
set lines [lreplace $lines end end]
if { $status == 0 } {
if { [string equal [lindex $lines 0] "200- Request not found"] } {
set output "-:[b]:[b] [c]$ioBvar(color1)error[c] [b]:[b]:- Request number [b]$arg[b] not found: check !requests for correct request number"
ioB:tsend chan $chan $output
} else {
set lines [split [lindex $lines 0] :]
set reqfilled [string trim [lindex $lines 1]]
set output "-:[b]:[b] [c]$ioBvar(color1)filled request[c] [b]:[b]:- [b]\[%request\][b] > [b]\[REQ\]-%reqfilled[b] filled by [b]%user[b]@iRC"
set output [ioB:replacevar $output "%user" $nick]
set output [ioB:replacevar $output "%request" $arg]
set output [ioB:replacevar $output "%reqfilled" $reqfilled]
ioB:tsend chan $chan $output
}
}
} else {
set output "-:[b]:[b] [c]$ioBvar(color1)error[c] [b]:[b]:- Request number not found: $arg is not a number"
ioB:tsend chan $chan $output
}
That can be done go also the old things!bw!help

boumboOo
01-21-2006, 01:29 PM
Threepw00d or harm you can put to us the file iobanana.tcl config for the request or not?

Harm
01-21-2006, 05:14 PM
This is already available in ioB2 which was released at the end of august 2005.

WarC has kindly added a new feature to ioA that allows me to specify the uid/gid of the requester. You need to configure it but it's like you were requesting using the site commands.

boumboOo
01-22-2006, 07:26 AM
yes my kan I type!request lost A put on IRC does not walk!!

Request_Line = " [%##] [%-10user] -> %request"
Request_Field = " -> "
Request_Max = 10
Request_Max_User = 4
Request_Excluded_User_0 = "sitebot"
Request_Too_Many_Made = " Too many requests made. Limit is %.0request"
Request_Too_Many_Made_User = " You have made too many request already. Limit is %.0request"
Request_Already_Made = " That is already requested"
Request_Output_Line = " Added request: %request"
Request_Log = ""%user" "%group" "%request""
Request_Add_Tag = 1
Request_Tag = "[REQ]-%REQUEST"
Request_IRC_Uid = 0
Request_IRC_Gid = 0
Request_Use_Uid-GID_from_IRC = 1