G:Line ID Script v.1.1.0.0

By Tamaki on May 29, 2009

I guess this is a good way to keep track of your own personal G:Lines. To install, simply load into your remotes and allow initialization. If it fails to provide an initialization, simply type /igid

Please note that in order for this script to work the power must be turned on.
To open the G:Line ID Script dialog, press F2 or type /gid. You can alternativley type /gid -d to open the dialog on the desktop.

In the box beside the text Nick, you can put the person's nick there (or ip, though i haven't tested if someone's ip would have the same effect). Beside the box where it says ID, click the Get New button (this button will only become available when you type something in the Nick box). In the reason box, type the main reason why you are G:Lining this person (there is no need to provide a period at the end of this as it does it for you auto-magically; this box can not be left blank). To set the G:Line, simply click the create button (you must have all areas filled out for this button to become available).

To adjust the auto-start option (which will open this dialog when you open irc), click the Auto Start item in the Manage menu. A check mark means it will start when you open irc. To adjust the power for the G:Line ID Script, click the Power item in the Manage menu. If the power is off (no check mark), the script will cease to function until or unless you turn the power back on. To view all your previously set G:Lines and delete them, click View Logs. To update your email address, click on the Set Email item in the Manage menu and supply a valid email address.

If you have any recommendations, i'll be glad to hear them. YOU DO NOT NEED TAD'S INTEGRATION SCRIPT FOR THIS ONE.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;G:Line ID Script;;;;;;;;;;;;
;;;;;The_Almighty_Duelist's Scripts;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;Loading and Starting;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

on *:LOAD: {
  writeini gline.ini status lines 0
  writeini gline.ini status power on
  writeini gline.ini settings auto_start on
  writeini gline.ini settings email $$?="Please enter your email address."
  writeini gline.ini status installed yes
  titlebar (C)2009 DJ Bill Enterprizes
}

on *:START: {
  If ($readini(gline.ini,settings,auto_start) == on) {
    If ($power == on) {
      dialog -m gline gline
    }
    Else {
      echo -a Type /gid or press F2 to start the G:Line ID Script. You can also type /gid -d to open the window on the desktop.
    }
  }
  Else {
    echo -a Type /gid or press F2 to start the G:Line ID Script. You can also type /gid -d to open the window on the desktop.
  }
  titlebar (C)2009 DJ Bill Enterprizes
}

alias igid {
  If ($readini(gline.ini,status,installed) == yes) {
    writeini gline.ini status power on
    writeini gline.ini status auto_start on
    writeini gline.ini settings email $$?="Please enter your email address."
  }
  Else {
    writeini gline.ini status lines 0
    writeini gline.ini status power on
    writeini gline.ini settings auto_start on
    writeini gline.ini settings email $$?="Please enter your email address."
    writeini gline.ini status installed yes
  }
}

;;;;;;;;;;;;;;;;;
;;;;;Aliases;;;;;
;;;;;;;;;;;;;;;;;

alias -l power {
  return $readini(gline.ini,status,power)
}

alias -l lines {
  return $readini(gline.ini,status,lines)
}

alias gid {
  If ($1 == $null) {
    dialog $iif($dialog(gline),-v,-m gline) gline
  }
  Elseif (-d isin $1) {
    dialog $iif($dialog(gline),-xmd gline,-md gline) gline
  }
}

alias f2 {
  dialog $iif($dialog(gline),-v,-m gline) gline
}

alias -l g_email {
  return $readini(gline.ini,settings,email)
}

alias setgline {
  If ($1 != $null) {
    var %temp.1 $calc($lines + 1)
    writeini gline.ini %temp.1 nick $1
    writeini gline.ini %temp.1 reason $iif($2 != $null,$2-,No Reason Given)
    gline $1 Your G:Line ID is %temp.1 $+ . Please email $g_email for information on the G:Line. Reason: $iif($2 != $null,$2-,No Reason Given)
    echo -a $1 G:Line has been set. "Your G:Line ID is %temp.1 $+ . Please email $g_email for information on the G:Line. Reason: $iif($2 != $null,$2-,No Reason Given)
    writeini gline.ini status lines %temp.1
  }
  Else {
    echo -a Error on Nicklist Menu.
  }
}

;;;;;;;;;;;;;;;;;
;;;;;Dialogs;;;;;
;;;;;;;;;;;;;;;;;

dialog gline {
  title G:Line ID Script
  option dbu
  size -1 -1 132 55
  text "IP", 100, 1 1 30 10
  text "ID", 101, 1 11 30 10
  text "Reason", 102, 1 22 30 10
  edit "", 200, 31 1 100 10, autohs
  edit "", 201, 31 11 69 10, read autohs right
  edit "", 202, 31 22 100 10, autohs disable
  button "Get New", 1, 101 11 29 10, disable
  button "Create", 2, 1 33 131 10, disable
  button "Reset", 3, 1 44 131 10
  menu "Manage", 300
  item "Auto-start", 400, 300
  item "Power", 401, 300
  item break, 950, 300
  item "View Logs", 402, 300
  item "Set Email", 403, 300
}

dialog v.gline {
  title View G:Lines
  option dbu
  size -1 -1 132 117
  combo 500, 1 1 131 50
  text "Nick", 100, 1 51 30 10
  text "ID", 101, 1 62 30 10
  text "Reason", 102, 1 73 30 10
  edit "", 200, 31 51 100 10, autohs
  edit "", 201, 31 62 100 10, read autohs right
  edit "", 202, 31 73 100 10, autohs
  button "Refresh", 1, 1 84 131 10
  button "Delete", 2, 1 95 131 10, disable
  button "Back", 3, 1 106 131 10
}

;;;;;;;;;;;;;;;;;;;;;;;
;;;;;Dialog Events;;;;;
;;;;;;;;;;;;;;;;;;;;;;;

on *:DIALOG:gline:*:*: {
  If ($power == on) {
    If ($devent == edit) {
      If ($did == 200) {
        did -e gline 1
      }
      If ($did == 202) {
        did -e gline 2
      }
    }
    If ($devent == sclick) {
      If ($did == 1) {
        did -ra gline 201 $calc($lines + 1)
        did -ef gline 202
      }
      If ($did == 2) {
        If (($did(200) != $null) && ($did(202) != $null)) && ($did(201) != $null) {
          gline *@ $+ $did(200) Your G:Line ID number is: $did(201) and you have been banned because: $did(202) $+ . Please email $g_email with your G:Line ID number for more info.
          echo -a Your G:Line ID number is: $did(201) and you have been banned because: $did(202) $+ . Please email $g_email with your G:Line ID number for more info.
          writeini gline.ini $did(201) nick *@ $+ $did(200)
          writeini gline.ini $did(201) reason $did(202)
          writeini gline.ini status lines $did(201)
          did -b gline 1,2
          did -r gline 200-202
        }
        Else {
          echo -a Please fill out the entire form.
        }
      }
      If ($did = 3) {
        did -r gline 200-202
        did -b gline 1,2,202
        did -f gline 200
      }
    }
    If ($devent == menu) {
      If ($did == 400) {
        If ($readini(gline.ini,status,auto_start) == on) {
          writeini gline.ini status auto_start off
          did -u gline 400
        }
        Else {
          writeini gline.ini status auto_start on
          did -c gline 400
        }
      }
      If ($did == 401) {
        If ($power == on) {
          writeini gline.ini status power off
          did -u gline 401
        }
        Else {
          writeini gline.ini status power on
          did -c gline 401
        }
      }
      If ($did == 402) {
        dialog -x gline
        dialog -m v.gline v.gline
      }
      If ($did == 403) {
        dialog -x gline
        writeini gline.ini settings email $?="Please enter your new email address."
        echo -a Set your new email (for G:Line ID Script) to: $g_email
        dialog -m gline gline
      }
    }
    If ($devent == init) {
      If ($power == on) {
        did -c gline 401
      }
      If ($readini(gline.ini,status,auto_start) == on) {
        did -c gline 400
      }
    }
  }
  Else {
    If ($devent == menu) {
      If ($did == 401) {
        writeini gline.ini status power on
        did -c gline 401
      }
    }
  }
}

on *:DIALOG:v.gline:*:*: {
  If ($power == on) {
    If ($devent == init) {
      var %temp.1 $lines
      var %temp.2 1
      While (%temp.2 <= %temp.1) {
        If ($readini(gline.ini,%temp.2,nick) != $null) {
          did -a v.gline 500 %temp.2
        }
        inc %temp.2
      }
    }
    If ($devent == sclick) {
      If ($did == 500) {
        did -ra v.gline 200 $readini(gline.ini,$did(500).seltext,nick)
        did -ra v.gline 201 $did(500).seltext
        did -ra v.gline 202 $readini(gline.ini,$did(500).seltext,reason)
        did -e v.gline 2
      }
      If ($did == 1) {
        dialog -x v.gline
        dialog -m v.gline v.gline
      }
      If ($did == 2) {
        gline - $+ $did(200)
        echo -a G:Line $did(201) for $did(200) has been removed. Reason for G:Line in the first place: $did(202)
        remini gline.ini $did(201)
        dialog -x v.gline
        dialog -m v.gline v.gline
      }
      If ($did == 3) {
        dialog -x v.gline
        dialog -m gline gline
      }
    }
    If ($devent == edit) {
      If ($did == 200) {
        did -ra v.gline 200 $readini(gline.ini,$did(500).seltext,nick)
      }
      If ($did == 202) {
        did -ra v.gline 202 $readini(gline.ini,$did(500).seltext,reason)
      }
    }
  }
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;Nicklist Menu;;;;;;;;;;;;
;;;;;At the request of a friend;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

menu nicklist {
  .GLine ID
  ../gline (noreason): /setgline $replace($address($$1, 3),$left($address($$1, 3), 2),)
  ../gline (reason): /setgline $replace($address($$1, 3),$left($address($$1, 3), 2),) $$?="Please enter reason here."
}

Comments

Sign in to comment.
Tamaki   -  May 29, 2009

@WorldDMT, i appologize, i didn't know what those things were
@napa182, thanks for clarifiying that

 Respond  
napa182   -  May 29, 2009

The_Almighty_Duelist Said:

I write if($dialog(gline) == gline) so that if the window is open and you type the command to open it, it won't return the error dialog already open

but, if you think that would take the quality of the script down significantly, i won't argue

um ..

dialog $iif($dialog(gline),-v,-m gline) gline

or

dialog $iif($dialog(gline),-v,-m) gline gline

does the check as well

 Respond  
Tamaki   -  May 29, 2009

I write if($dialog(gline) == gline) so that if the window is open and you type the command to open it, it won't return the error dialog already open

but, if you think that would take the quality of the script down significantly, i won't argue

 Respond  
WorldDMT   -  May 29, 2009

hi

i saw it quickly but why u write too much thing u can remove it like

If ($dialog(gline) == gline) = If ($dialog(gline))

and your alias gid u can make it better too shorter

alias gid dialog $iif($dialog(gline),-v,-m $+ $iif($1 == -d,$v1) gline) gline

only that is all u need in 1 line instead 20

same for F2

alias f2 dialog $iif($dialog(gline),-v,-m gline) gline
 Respond  
Tamaki   -  May 29, 2009

Update from v.1.0.0.0 to v.1.0.1.0

Fixed the acutal /gline command. It returned, no such nick prior to the update, now actually executes a proper G:Line.

Coincedentally, this now only works for IP addresses.


Update from v.1.0.1.0 to v.1.0.1.1

Made the script more functional, as in, stops you from clicking 'Create' and getting that annoying error message unless the entire form is filled out. When you click the 'Get New' button, it will auto-magically set the focus to the Reason box, and updated the Reset button accordingly.


Update from v.1.0.1.1 to v.1.0.1.2

The word Reason was in the wrong place, blocking the work ID in the main dialog box.


Update from v.1.0.1.2 to v.1.1.0.0

Made the script more stream-lined thanks to the original help from WorldDMT (my appologies for earlier) and the clarification from napa182.

The main reason why I made a major upgrade was because a friend of mine asked me to add a Nicklist Menu to it. This provides a way to (right) click on a nick and select GLine ID, and select a /gline option, for-instance, whether or not to give a reason for the gline. This is still not optional for the dialog box, but it might later.

TheWhistler  -  Oct 06, 2014

anyway to have this where you can set the ban time limit
this way i would love it
but its great as it is but i like to set time limits on the gline
i converted from gline to gzline now just need to set ban time limits like 30d, 10d 1h etc

Sign in to comment

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.