This is a simple dialog (well, simple to use, I hope), that tracks any and all invitations sent to you on your current network. You can accept or decline (with a reason) any or all of the invitations, as well as auto-accept or auto-decline selected or all invitations. NOTE: An invitation must be received before Auto-accept or Auto-Decline will work.
dialog Invite_Control {
size -1 -1 290 155
option pixels
text "Invite List", 1, 5 5 100 16, center
list 2, 5 20 100 110, size check
button "Checked", 3, 115 15 75 25, disable
button "All", 6, 115 45 75 25
button "Automatic", 8, 115 75 75 25
link "Russel Bairstow", 10, 200 114 75 16
button "Close", 11, 110 110 75 20, ok cancel
box "Accept", 12, 110 0 85 105
box "Decline", 4, 193 0 85 105
button "Checked", 5, 198 15 75 25, disable
button "All", 7, 198 45 75 25
button "Automatic", 9, 198 75 75 25
}
ctcp *:version:*: ctcpreply $nick VERSION Invite Control 04.12.2008 by Russel Bairstow
on *:dialog:Invite_Control:*:*:{
if $devent == init {
dialog -t $dname Invite Control for $network
var %a = 1, %b = $ini($invite,$network,0)
while %a <= %b {
var %ic.chan = $ini($invite,$network,%a), %query = $readini($invite,n,$network,%ic.chan)
if Decline !isin %query && Accept !isin %query && %ic.chan !ischan { did -a $dname 2 %ic.chan }
inc %a
}
}
elseif $devent == sclick {
if $did == 10 { url -n mailto:r.k.bairstow@gmail.com?subject=Invite_Control_04.12.2008 }
elseif $did == 2 {
var %invite.chan = $iif($istok(%invite.chan,$did(2).seltext,44),$remtok(%invite.chan,$did(2).seltext,1,44),$addtok(%invite.chan,$did(2).seltext,44))
did $iif($did(2,0).csel,-e,-b) $dname 3,5
}
elseif $did == 3 {
.join %invite.chan
}
elseif $did == 6 {
var %invite.chan = $didtok($dname,2,44)
.join %invite.chan
}
elseif $did == 8 {
var %a = 1, %b = $did(2).lines
while %a <= %b {
.writeini -n $invite $network $did(2,%a) Accept
.join $did(2,%a)
inc %a
}
}
elseif $did == 5 {
if $did(2,0).csel = 1 {
var %inv.chan = $did(2).seltext, %inviter = $readini($invite,n,$network,%inv.chan)
var %ic.decline = $input(Enter reason for declining invite from %inviter to %inv.chan,e,,No reason given)
.notice %inviter Invitation to join %inv.chan has been declined for the following reason: %ic.decline
}
else {
var %ic.decline = $input(Do you want to use the same reason for all $did(2,0).csel requests,y)
if %ic.decline {
var %ic.decline = $input(Enter reason to be used for all of the currently selected invites,e,,No reason given)
var %a = 1, %b = $did(2,0).csel
while %a <= %b {
.timer 1 %a .notice $readini($invite,n,$network,$did(2,%a).csel) Invitation to join $did(2,%a).csel has been declined for the following reason: %ic.decline
inc %a
}
}
else {
var %a = 1, %b = $did(2,0).csel
while %a <= %b {
var %inv.chan = $did(2,%a).csel, %inviter = $readini($invite,n,$network,%inv.chan)
var %ic.decline = $input(Enter reason for declining invite from %inviter to %inv.chan,e,,No reason given)
.notice %inviter Invitation to join %inv.chan has been declined for the following reason: %ic.decline
inc %a
}
}
}
}
elseif $did == 7 {
var %ic.decline = $input(Enter reason to be used for all of the current invites,e,,No reason given)
var %a = 1, %b = $did(2).lines
while %a <= %b {
.timer 1 %a .notice $readini($invite,n,$network,$did(2,%a)) Invitation to join $did(2,%a) has been declined for the following reason: %ic.decline
inc %a
}
}
elseif $did == 9 {
var %ic.decline = $input(Do you want to use the same reason for all $did(2,0).csel requests,y)
if %ic.decline {
var %ic.decline = $input(Enter reason to be used for all of the currently selected invites,e,,Auto-Declined)
var %a = 1, %b = $did(2,0).csel
while %a <= %b {
.timer -m 1 $calc(%a * 1000) .notice $readini($invite,n,$network,$did(2,%a).csel) Invitation to join $did(2,%a).csel has been declined for the following reason: %ic.decline
if decline !isin %ic.decline { %ic.decline = Declined for %ic.decline }
.timer -m 1 $calc((%a + .5) * 1000) .writeini -n $invite $network $did(2,%a).csel %ic.decline
inc %a
}
}
else {
var %a = 1, %b = $did(2,0).csel
while %a <= %b {
var %inv.chan = $did(2,%a).csel, %inviter = $readini($invite,n,$network,%inv.chan)
var %ic.decline = $input(Enter reason for declining invite from %inviter to %inv.chan,e,,No reason given)
.notice %inviter Invitation to join %inv.chan has been declined for the following reason: %ic.decline
if decline !isin %ic.decline { %ic.decline = Declined for %ic.decline }
.writeini -n $invite $network $did(2,%a).csel %ic.decline
inc %a
}
}
}
}
}
on *:invite:#:{
if $chan ischan { .notice $nick I'm already in $chan $+. Thanks for the invite anyways. }
else {
if !$ini($invite,$network,$chan) {
.writeini -n $invite $network $chan $nick
if $dialog(Invite_Control) && !$didwm(Invite_Control,2,$chan) { did -a Invite_Control 2 $chan }
}
else {
if $readini($invite,n,$network,$chan) == Accept { .join $chan }
elseif Decline isin $v1 { .notice $1 Invitation to $chan has been declined due to $v1 }
}
}
}
menu * {
Invite Control : ic
}
alias ic {
if $dialog(Invite_Control) { dialog -evh Invite_Control Invite_Control }
elseif !$ini($invite,$network,0) { echo 4 -a No Invitations have been received on $network }
else {
var %a = 1, %b = $ini($invite,$network,0)
while %a <= %b {
var %invite.chan = $ini($invite,$network,%a), %invite.nick = $readini($invite,n,$network,%invite.chan)
if Decline !isin %invite.nick && Accept !isin %invite.nick { dialog -mdh Invite_Control Invite_Control }
inc %a
}
if !$dialog(Invite_Control) { echo 4 -a All received invitations on $network have been auto-accepted or auto-declined }
}
}
alias -l invite {
return $qt($scriptdirinvite.ini)
}
Eugenio: I\'m obviously not blind, or I wouldn\'t be able to read the comment that were made. I made a simple request, and a request is all it was. If I wanted to ensure that only relevant comments were made, I would\'ve just deleted the irrelevant posts and not bothered making my request.
napa182: Would you kindly check your other scripts to see if any of them also use %invite.chan as either a global or local variable? If there is, that might account for the error you got, as the join command uses that variable to track the names of the channels to be joined by the invitation issued. Other than that, I can\'t (at the moment) think of any reason why that error would show.
Go to your image URL: http://www.hawkee.com/profile/img/1501/
Find the BBCode below the image and copy it. Then edit your snippet and paste it into your Introduction. Let me know if you have any problems.