AddText

By Aucun50 on Jan 24, 2009

This is my first dialog took me a long time to get everything where it is.
This has a few setting for it:

Ops and higher
Halfops and higher
voiced and higher
Everyone
Off

What it does it adds a text file to your mIRC folder (in app data) with what every you typed, not sure if anyone would use it because it can spam your computer with files or mIRC with text.

I plan to put option like:

More checks
Flood protection
Delete/clear file

Please point out any mistakes or errors i made also post suggestion for new thing you think need or want to be added.

dialog Allows {
  Title "Main"
  Size -1 -1 80 60
  option dbu
  Radio "Ops And Higher", 1, 1 10 50 10 
  Radio "Half And Higher", 2, 1 20 50 10 
  Radio "Voice And Higher", 3, 1 30 50 10
  Radio "Everyone", 4, 1 40 50 10  
  Radio "Off", 5, 1 50 50 10  
  Text "Check One of The Following", 11, 1 1 71 8
}
on *:DIALOG:Allows:*:*: {
  var %a = $dname, %b = $devent, %c = $did
  if (%b == sclick) {
    if (%c == 1) { set %opl 1 }
    if (%c == 2) { set %hol 2 }
    if (%c == 3) { set %vol 3 }
    if (%c == 4) { set %evl 4 }
    if (%c == 5) { set %offl 5 }   
  }
}
on *:TEXT:*:#: {
  if ($($+(%,flood,$nick),2) == 2) { ignore -u180 $nick | unset $+(%,flood,$nick) | halt }
  if (!addtext == $strip($1)) && ($strip($2)) {
    var %a = write $2 $3- | .notice $nick $+($2,.txt) has been added
    if (%opl == 1) && ($nick isop $chan) { %a }
    elseif (%hol == 2) && ($nick ishop $chan) { %a }
    elseif (%vol == 3) && ($nick isvoice $chan) { %a }
    elseif (%evl == 4) { %a }
    elseif (%offl == 5) { .notice $nick Addtext is off }
    $iif($($+(%,flood,$nick),2),inc $+(%,flood,$nick) 1,set -u10 $+(%,flood,$nick) 1)
  }
  elseif (!view == $strip($1)) && ($strip($2)) {
    if ($exists($2)) { play $chan $2 }
    else { .msg $chan I do not have that file $+($nick,$chr(46)) }
    $iif($($+(%,flood,$nick),2),inc $+(%,flood,$nick) 1,set -u10 $+(%,flood,$nick) 1)
  }
  else { halt }
} 
menu * {
  Allow Editer: dialog $iif($dialog(Allows),-v,-m) Allows Allows | unset %opl %hol %vol %evl %offl
}

Comments

Sign in to comment.
PATX   -  Mar 14, 2009

nice i give it a 5

 Respond  
Aucun50   -  Jan 25, 2009

I see thank you.

 Respond  
Firstmate   -  Jan 25, 2009

If you put $2.txt it thinks you have some sort of identifier and tries to call $2.txt. You don't want that. Instead you need to use something called concatenation to combine $2 and .txt

e.g.
$+(n,x,y) lets you combine n x and y.

 Respond  
Aucun50   -  Jan 25, 2009

I have no idea what the difference between "$2.txt" and "$+($2,.txt)" could you explain please?

 Respond  
PuNkTuReD   -  Jan 25, 2009

gd catch Bushak

 Respond  
Bushak   -  Jan 25, 2009

notice $+($2,.txt) ..... not $2.txt

 Respond  
Aucun50   -  Jan 24, 2009

Sorry forgot to change it thank you for pointing that out.

 Respond  
PuNkTuReD   -  Jan 24, 2009

in your dialog you set
set %opl 1
set %hol 2
set %vol 3
set %evl 4
set %offl 5

but in the script you have
if (%aol == 1)
elseif (%ool == 2)
elseif (%hol == 3)
elseif (%evl == 4)
elseif (%offl == 5)

i dont see where these vars get set
if (%aol == 1)
elseif (%ool == 2)
elseif (%hol == 3)

i also dont see where these variables get used
set %opl 1
set %vol 3

 Respond  
Aucun50   -  Jan 24, 2009

One more update flood protection added by PunkTured.

 Respond  
Aucun50   -  Jan 24, 2009

ill have to find out how to do that, should have it with flood protection soon + more check and if i can more options.

 Respond  
PuNkTuReD   -  Jan 24, 2009

6/10 nice m8, gtta add some flood protection for those on text events

 Respond  
Aucun50   -  Jan 24, 2009

Updated again

 Respond  
PuNkTuReD   -  Jan 24, 2009

i didnt test this, but you could check if the file exists before you try to play it

elseif (!view == $strip($1)) && ($strip($2)) { 
  if ($exists($2)) { play $chan $2 }
  else { .msg $chan I do not have that file $+($nick,$chr(46)) }
}

also

  menu "Check One of The Following", 11 

would be better as

  text "Check One of The Following", 11, 2 2 71 8
 Respond  
Aucun50   -  Jan 24, 2009

Updated

 Respond  
PuNkTuReD   -  Jan 24, 2009

u dnt really need the halt
and lol i didnt notice the %nick
tbh i doubt u even need the
else
statement

 Respond  
Aucun50   -  Jan 24, 2009

Thanks ill fix that stuff, btw:
elseif (%ool == 2) && (%nick isop $chan) { %a } - %nick? Lol :), else { } - is it { halt }?

 Respond  
PuNkTuReD   -  Jan 24, 2009

heres one thatll come in handy

  var %a = $dname, %b = $devent, %c = $did
  if (%b == sclick) {
    if (%c == 2) {

and the dialogs $iif for incase you try to open the dialog once its already open

Allow Editer: dialog $iif($dialog(Allows),-v,-m) Allows Allows

u also dont need to check if $1 == !addtext so much

on *:TEXT:*:#: {
  if (!addtext == $strip($1)) && ($strip($2)) {
    var %a = write $2 $3- | .notice $nick $2.txt has been added
    if (%aol == 1) && ($nick isaop $chan) { %a }
    elseif (%ool == 2) && (%nick isop $chan) { %a }
    elseif (%hol == 3) && ($nick ishop $chan) { %a }
    elseif (%evl == 4) { %a }
    elseif (%offl == 5) { .notice $nick Addtext is off }
  }
  elseif (!view == $strip($1)) && ($strip($2)) { play $chan $2 }
  else {  }
}
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.