Username:
Password:
  Home About Us Articles Rules Script Library FAQ Help
Not logged in (register
Exportline script for mIRC v6.14

Last Modified: Nov 22 10:35am (r17)

bind a key to /exportline

if you have intels in the clipboard just hit the key and it will say the export line in the channel / query

fixed some regexp bugs
alias F5 exportline
alias /exportline {
  ;-- Iterator vars
  var %i = 1
  var %j = $cb(0)
  ;-- RegExp's
  var %re.eline /\*\* Export Line \[ver ([\d]+)\] -- (.*) \[ver ([\d]+)\]: \*\*/
  var %re.pname /(The Province of|Buildings Report of|Science Intelligence on|Military Intelligence on) (.*) \(([\d]+):([\d]+)\)/
  var %re.netdef /Net Defense at Home \(from Utopia\): (.*)/
  var %re.back /\*\* Armies [#\/\d]+ \(Back in (.*) hours\) \*\*/
  ;-- Scan the Clipboard
  while (%i <= %j) {
    ;-- Get Province name
    if ($regex($cb(%i),%re.pname)) {
      var %el.pname $regml(2) ( $+ $regml(3) $+ : $+ $regml(4) $+ )
    }
    if ($regex($cb(%i),%re.netdef)) {
      var %el.netdef $regml(1) 
    }
    if ($regex($cb(%i),%re.back)) {
      say !xarmy $replace($regml(1),$chr(58),$chr(46)) %el.pname
    }
    ;-- Get Exportline and Type
    if ($regex($cb(%i),%re.eline)) {
      var %el.type = $regml(2) v. $+ $regml(1) $+ . $+ $regml(3)
      var %k $calc(%i +1)
      while ((%k <= %j) && ($cb(%k) != $null)) {
        var %el.eline %el.eline $cb(%k)
        inc %k
      }
    }
    inc %i
  }
  if (%el.eline != $null) {
    ;-- Vars
    ; %el.pname = province name
    ; %el.eline = exportline
    ; %el.type = exportline type and version
    ; %el.netdef = netdef home (som only)
    say $+(IRC Export Line » %el.eline « %el.pname %el.type)
    if (%el.netdef != $null) say NetDef(home): %el.netdef
  }
  else {
    echo -tmg 4 !
  }
}
;-- Makes the Exportline clickable
on ^*:hotlink:*:*:{
  if ($regex($hotline,/IRC Export Line » (.*) «/)) {
    ; exportline is in $regml(1)
    if ($mouse.key & 1) clipboard $regml(1)
    return
  }
  else {
    halt
  }
}

Comments
arcane
Jan 22 4:59pm
That's pretty cool ... the syntax to bind to a function key is this, in remotes.

alias F5 exportline

That example would make it so when you press F5, it's the same as typing /exportline
secretz
Jan 25 2:05pm
You know, to make it really full, you could make $exportline and /exportline and an option to say primary but a possibility to echo too.

Oh, and cant see a reason to use global identifiers.. except to remember the last line?
Ruey
Feb 03 4:48pm
Is it just me, or do other people get !exportline error! all the time? I use angel 1.63 beta
cerberus
Feb 06 7:26am
it works for me with 1.63 beta

jyou need the formated intel in your clipboard. then it will work

if the script cant find "
** Export Line [ver ?] -- ? [ver ?]: **" in the clipboard it gives you the error message, if it finds the export line header it will automaticly take all lines under the header and then post it in the active channel/query.
Franimus
Feb 21 7:18am
you should make a way to read export lines that are posted in the channel...
cerberus
May 01 2:19pm
well this scripts only purpose is to post the export lines in a quick easy way ( in general you just hit F5 )

pauly wrote one for scanning channels you can use both at same time, why invent the wheel twice...
 
All content Copyright © 2004 - 2008 UtoNet IRC Network
UtoNet is sponsored and hosted by Datinix Systems