Author Topic: Script Conversion Help Needed!!!  (Read 2804 times)

pokereyes

  • Newbie
  • *
  • Posts: 6
Script Conversion Help Needed!!!
« on: March 29, 2011, 08:12:50 AM »
Hello,

I am having a big problem with converting a script to work in Icechat I have always used mirc and now want to permanently switch to ice but need to convert a script I have that kicks a nicks notices to a separate window plus a few other functions as the scripting format for ice is different than I am used to I was hoping someone here might be able to help below you will find the script I am working with at the moment the right click menu doesn't display properly and when you click nothing happens.

Code: [Select]
on ^*:NOTICE:*:#channelname:{
  if ($nick == Martin || $nick == Martin1 || $nick == Martin_) {
    if : isin $strip($1) { set %nzbposts.line $gettok($iif(%nzbposts.stripped == $true,$strip($1),$1),1,58) $iif(%nzbposts.stripped == $true,$strip($2-),$2-) }
    else { set %nzbposts.line $iif(%nzbposts.stripped == $true,$strip($1-),$1-) }
    ;write @posts.log $asctime(yyyy-mm-dd) $timestamp %nzbposts.line
    if (%nzbposts.mywindow == $true) && ($remove($strip($3),$chr(40),$chr(41)) == %nzbposts.myeditor) {
      if ($window(@MyPosts) == $null) { window -vn1g2 @MyPosts }
      aline @MyPosts $asctime(yyyy-mm-dd) $timestamp %nzbposts.line
      titlebar @MyPosts ] [ $line(@MyPosts,0) Lines ] [ Latest: %nzbposts.line ]
    }
    if (%nzbposts.window == $true) {
      if (%nzbposts.mywindow == $true && $remove($strip($3),$chr(40),$chr(41)) == %nzbposts.myeditor && %nzbposts.myinclude == No) { goto skip }
      if ($window(@Posts) == $null) { window -vn1g2 @Posts }
      if (%nzbposts.queuetype != $null) { aline @Posts  $asctime(yyyy-mm-dd) $timestamp [SAB] %nzbposts.line }
      else { aline @Posts  $asctime(yyyy-mm-dd) $timestamp %nzbposts.line }
      titlebar @Posts ] [ $line(@Posts,0) Lines ] [ Latest: %nzbposts.line ]
    }
    :skip
    unset %nzbposts.line
    if (%nzbposts.url == $null) { nzb_posts.setup }
    if (%nzbposts.chanfilter == $true) { haltdef }
  }
}

on ^1:HOTLINK:*:#Channelname:{
  if ($mouse.key & 1) && (Martin isin $gettok($strip($hotline),2,32)) {
    if ($gettok($hotlinepos,1,32) == 3) {
      if :: isin $gettok($strip($hotline),4,32) { url http:// $+ %nzbposts.url $+ .newzbin.com/browse/cat/p/ $+ $replace($gettok($strip($hotline),4,32),::,/) $+ / }
      else { url http:// $+ %nzbposts.url $+ .newzbin.com/browse/cat/p/ $+ $gettok($strip($hotline),4,32) $+ / }
    }
    elseif ($gettok($hotlinepos,1,32) == 4) {
      if (%nzbposts.url = www) { url http:// $+ %nzbposts.url $+ .newzbin.com/browse/editor/ $+ $remove($gettok($strip($hotline),5,32),$chr(40),$chr(41)) }
      else { url http:// $+ %nzbposts.url $+ .newzbin.com/browse/all/p/?u_username= $+ $remove($gettok($strip($hotline),5,32),$chr(40),$chr(41)) }
    }
    elseif ($gettok($hotlinepos,1,32) >= 5) && (%nzbposts.titleclick == $true) {
      url http:// $+ %nzbposts.url $+ .newzbin.com/browse/post/ $+ $gettok($strip($hotline),3,32)
      return
    }
    return
  }
  ;if ((Martin isin $gettok($strip($hotline),2,32) && ($gettok($hotlinepos,1,32) == 3 || $gettok($hotlinepos,1,32) == 4 || $gettok($hotlinepos,1,32) == 5)) || (Martin isin $gettok($strip($hotline),2,32 && $gettok($hotlinepos,1,32) >= 3 && %nzbposts.titleclick == $true) {
  ;  return
  ;}
  haltdef
}
on ^1:HOTLINK:*:@MyPosts,@Posts:{
  if ($mouse.key & 1) && ($gettok($hotlinepos,1,32) == 3) {
    url http:// $+ %nzbposts.url $+ .newzbin.com/browse/post/ $+ $strip($1)
    return
  }
  elseif ($mouse.key & 1) && ($gettok($hotlinepos,1,32) == 4) {
    if :: isin $gettok($hotline,3,32) { url http:// $+ %nzbposts.url $+ .newzbin.com/browse/cat/p/ $+ $replace($gettok($strip($hotline),3,32),::,/) $+ / }
    else { url http:// $+ %nzbposts.url $+ .newzbin.com/browse/cat/p/ $+ $gettok($strip($hotline),4,32) $+ / }
    return
  }
  elseif ($mouse.key & 1) && ($gettok($hotlinepos,1,32) >= $iif(%nzbposts.queuetype,5)) && (%nzbposts.titleclick == $true) {
    url http:// $+ %nzbposts.url $+ .newzbin.com/browse/post/ $+ $gettok($strip($hotline),3,32)
    return
  }
  elseif ($gettok($hotlinepos,1,32) == 3) || ($gettok($hotlinepos,1,32) == 4) || ($gettok($hotlinepos,1,32) >= 5 && %nzbposts.titleclick == $true) { return }
  halt
}

menu @Posts,@MyPosts,channel {
  $iif($active == @Posts || $active == @MyPosts || $active == #Channelname,#Channelname @Posts)
  .Filter Channel Notices
  ..$style($iif(%nzbposts.chanfilter,1,0)) On { set %nzbposts.chanfilter $true }
  ..$style($iif(%nzbposts.chanfilter,0,1)) Off { set %nzbposts.chanfilter $false }
  .-
  .@Posts Window
  ..$style($iif(%nzbposts.window,1,0)) On { set %nzbposts.window $true | window -vn1g2 @Posts }
  ..$style($iif(%nzbposts.window,0,1)) Off { set %nzbposts.window $false | window -c @Posts }
  .$iif(%nzbposts.window == $true,@Posts Strip Colours)
  ..$style($iif(%nzbposts.stripped,1,0)) On { set %nzbposts.stripped $true }
  ..$style($iif(%nzbposts.stripped,0,1)) Off { set %nzbposts.stripped $false }
  .-
  .@MyPosts Window
  ..$style($iif(%nzbposts.mywindow,1,0)) On { set %nzbposts.mywindow $true | window -vn1g2 @MyPosts }
  ..$style($iif(%nzbposts.mywindow,0,1)) Off { set %nzbposts.mywindow $false | window -c @MyPosts }
  ..Editor ( $+ %nzbposts.myeditor $+ ) { set %nzbposts.myeditor $?="Type in the editor name to watch for:"  }
  .$iif(%nzbposts.mywindow == $true,My reports in @Posts)
  ..$style($iif(%nzbposts.myinclude == yes,1,0)) Yes { set %nzbposts.myinclude Yes }
  ..$style($iif(%nzbposts.myinclude == no,1,0)) No { set %nzbposts.myinclude No }
  .-
  .Clickable titles
  ..$style($iif(%nzbposts.titleclick,1,0)) On { set %nzbposts.titleclick $true }
  ..$style($iif(%nzbposts.titleclick,0,1)) Off { set %nzbposts.titleclick $false }
  .-
  .Select Web Server
  ..$style($iif(%nzbposts.url == www,1,0)) www (default) { set %nzbposts.url www }
  ..$style($iif(%nzbposts.url == editors,1,0)) editors { set %nzbposts.url editors }
 
}

onJOIN:{ nzb_posts.setup }
onSTART:{ nzb_posts.setup }
alias nzb_posts.setup {
  if (%nzbposts.url == $null) {
    set %nzbposts.url www
  }
  if (%nzbposts.chanfilter != $true && %nzbposts.chanfilter != $false) { set %nzbposts.chanfilter $true }
  if (%nzbposts.window != $true && %nzbposts.window != $false) { set %nzbposts.window $true | window -vn1g2 @Posts }
  if (%nzbposts.stripped != $true && %nzbposts.stripped != $false) { set %nzbposts.stripped $true }
  if (%nzbposts.mywindow != $true && %nzbposts.mywindow != $false) { set %nzbposts.mywindow $false }
  if (%nzbposts.myinclude != Yes && %nzbposts.myinclude != No) { set %nzbposts.myinclude Yes }
  if (%nzbposts.titleclick != $true && %nzbposts.titleclick != $false) { set %nzbposts.titleclick $false }
}

Please I do hope somebody can point me in the right direction with this one as I am at a loss and cannot find anything clearly written for icechat scripting.

Thanks in Advance   

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Script Conversion Help Needed!!!
« Reply #1 on: March 29, 2011, 09:06:52 AM »
Sorry, but you are assuming we are fluent in mirc scripting to even understand that.

Which I am not, so I have no idea what the script even does.

You will need to break it down a bit to explain what each of those functions does.

And yes, that script will not work at all in IceChat, as IceChat only partially supports mirc scripting, not fully. I would think the script needs to be re-written entirely.

I don't even know what ON HOTLINK is for.
The IceChat God

pokereyes

  • Newbie
  • *
  • Posts: 6
Re: Script Conversion Help Needed!!!
« Reply #2 on: March 29, 2011, 10:14:09 AM »
Sorry about that was a bit presumptuous of me, as I know nothing about ice script so why should you know about mirc script  :-) I will better try to explain exactly what the script does or is meant to do.
Basically we have a bot that relays everything that is posted to the site in a notice in an irc channel which can be a bit annoying for some people so the script has a right click menu so you can switch the function on and off and the basic functions are that you can push the notices from the bot to a separate window. Secondly you can turn the notices into click-able url's so that you can click on the notice and go to the post (HOTLINK function). That to be honest are the required functions I need, the script I sent does more but it isn't actually necessary. I hope this is a little clearer of what I need to achieve and hope that you are able to help me or point me in the right direction.

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Script Conversion Help Needed!!!
« Reply #3 on: March 29, 2011, 11:10:49 AM »
Ok, well, here is the deal.

IceChat has no HOTLINK functionality. There is no script function fire when a link is clicked.

IceChat also does not have the capability of changing the messages before they are displayed to a window, and you can not forcibly remove them, like mirc can. You can either do it for ALL or NONE, there is no between. That scripting functionality was just never added.

2nd, IceChat has no way to move a user notice to another window with a script, it will still show in the current window or channel.

What IceChat does do though, is if you have a QueryWindow open for a user, all user notices and messages go to that window instead.

So basically what you are asking for, is not possible with the current version of IceChat. You can get it to partially work, but not to the extend you need it.

Sorry.
The IceChat God

pokereyes

  • Newbie
  • *
  • Posts: 6
Re: Script Conversion Help Needed!!!
« Reply #4 on: March 29, 2011, 11:55:22 AM »
Thank you very much for your answer and help I will just have to wait for a future release that does.

Again thanks for all the help and until the next time o/