PreDB.org mIRC Announcer v0.4

By OrFeAsGr on Feb 24, 2017

This is a script requested by my budd Wikked! I've made it in the past but some stuff changed in Predb.org source code and the script couldn't work. So i remade it and thought of sharing!
What this script does is simply relaying new content on Predb.org which is a pre release announcing site.

;;;;UPDATE 0.4 27/05/2017;;;;
Added (as requested) !predbrecent . Where N is a number of your choice. ;;;
;;; The bot will send the N most recent releases. ;;;
;;; If you don't use a number it will send the last 20. ;;;
;;;;UPDATE 0.4 27/05/2017;;;;

Input your channel(s) under alias predbch { where it says: YOUR_CHAN(s)_HERE . Seperate multiple channels with a comma.
Then go to the channel or one of the channels you wrote and type !predb
This command will turn on/off the checking timer.

Tips:

  1. A way for the command to be used only from nicks you allow to is to add a channel but make it invite only (+i channel mode) so only the people you want can use the command :) i could add a list of nicks but i'm bored :X
  2. You can change the order of the release info or add colours. Just don't stick colour codes onto the variables, they won't be evaluated.
    Good Luck! Have Fun! Please don't remove the adv message.. it won't be sent frequently.

Visit mIRC Land! See my scripts, get help or share your scripts, tips, tutorials. http://mirc-land.tk
Support my art work & my Youtube channel: http://orpheusgr.tk
<3
Do you want to earn me some cents without paying for anything? Visit http://humanity.ucoz.com after turning your adblock off, watch a short ad by shorte.st and turn it back on.
Or do you want to donate some bucks because you like my scripts??? Visit https://www.paypal.me/OrFeAsGr
Thx! ^_^

;;; Scipted by OrFeAsGr http://mirc-land.tk - Support my art work: http://orpheusgr.tk ;;;
;;; v0.4 27/05/2017 ;;;
;;; Fixed a bug in !presearch (the site changed the directory...) ;;;
;;; Added (as requested) !predbrecent <N> . Where N is a number of your choice. ;;;
;;; The bot will send the N most recent releases. ;;;
;;; If you don't use a number it will send the last 20.  ;;;
on *:TEXT:*:#:{
  if (!predb == $1) {
    if ($timer(predb).secs) {
      .timerpredb off
      .msg $predbch Pre Announce Stopped.
    }
    elseif (!$timer(predb).secs) {
      .timer 1 3 sockopen -e predb predb.org 443
      .timerpredb 0 60 sockopen -e predb predb.org 443
      .msg $predbch Pre Announce Started.
    }
  }
  if (!presearch == $1) {
    unset %predbsearch
    if ($3) {
      set %predbsearch.q $3-
      if ($2 isnum 1-10) {
        set %predbsearch.page $2
      }
      elseif ($2 !isnum 1-10) { msg $chan USAGE: !presearch <page>  <search term>  (page can be a number from 1 to 10) | return }
      sockopen -e predbsearch predb.org 443
      set %predbsearch.chan $chan
      msg $chan Type !prestop to stop the results.
    }
    elseif (!$3) { msg $chan USAGE: !presearch <page>  <search term>  (page can be a number from 1 to 10) }
  }
  if (!prestop == $1) { 
    if ($sock(predbsearch)) {
      .timerpredbsearch* off
      endpredb
    }
  }
  if (!predbrecent == $1) {
    set %predbrecent.num $iif($2 insum, $v1, 20)
    sockopen -e predbrecent predb.org 443
    set %predbrecent.chan $chan
  }
}

on *:SOCKOPEN:predb: {
  sockwrite -nt $sockname GET / HTTP/1.1
  sockwrite -nt $sockname Host: predb.org
  sockwrite $sockname $crlf
}

on *:SOCKOPEN:predbsearch: {
  sockwrite -nt $sockname GET $+(/search/,%predbsearch.q,/all,$iif(%predbsearch.page, $+(/page/,$v1), $null)) HTTP/1.1
  sockwrite -nt $sockname Host: predb.org
  sockwrite $sockname $crlf
}

on *:SOCKOPEN:predbrecent: {
  sockwrite -nt $sockname GET / HTTP/1.1
  sockwrite -nt $sockname Host: predb.org
  sockwrite $sockname $crlf
}

on *:SOCKREAD:predb: {
  var %predb
  sockread %predb
  if (*tr class="post" id=* iswm %predb) {
    var %id = $gettok(%predb,4,34)
    if (!%predblastid) || (%predblastid != %id) { set %predblastid %id }
    elseif (%predblastid == %id) { sockclose $sockname }
    ;;; %predblastid is not a typo. the dot is missing on purpose :) ;;;
  }
  if (*td class="pretime"* iswm %predb) { set %predb.time $gettok($gettok(%predb,2,62),1,60) }
  if (*td class="cat"* iswm %predb) { set %predb.catl $+(www.predb.org,$gettok(%predb,4,34)) | set %predb.cat $gettok(%predb,6,34) }
  if (*td class="grp"* iswm %predb) { set %predb.grpl $+(www.predb.org,$gettok(%predb,4,34)) | set %predb.grp $gettok(%predb,6,34) }
  if (*td class="rls"* iswm %predb) { 
    set %predb.rls $gettok(%predb,6,34)
    sockclose $sockname
    msg $predbch %predb.time Ago. Category: %predb.catl %predb.cat Group: %predb.grpl %predb.grp Title: %predb.rls
    inc %counterpredb
    if (%counterpredb == 5000) { .timer 1 5 msg $predbch Predb.org mIRC Announcer Scripted by OrFeAsGr! mIRC Scripts & More: http://mirc-land.tk - My art work: http://orpheusgr.tk | unset %counterpredb }
    unset %predb.*
  }
}

on *:SOCKREAD:predbsearch: {
  var %predb
  sockread %predb
  if (*tr class="post" id=* iswm %predb) { set %predbsearch.id $gettok(%predb,4,34) }
  if (*td class="pretime"* iswm %predb) { set %predbsearch.time $gettok($gettok(%predb,2,62),1,60) }
  if (*td class="cat"* iswm %predb) { set %predbsearch.catl $+(www.predb.org,$gettok(%predb,4,34)) | set %predbsearch.cat $gettok(%predb,6,34) }
  if (*td class="grp"* iswm %predb) { set %predbsearch.grpl $+(www.predb.org,$gettok(%predb,4,34)) | set %predbsearch.grp $gettok(%predb,6,34) }
  if (*td class="rls"* iswm %predb) { 
    .timerendpredb off
    set %predbsearch.rls $gettok(%predb,6,34)
    inc %predbsearch.resc 2
    $+(.timerpredbsearch,%predbsearch.resc) 1 %predbsearch.resc msg %predbsearch.chan %predbsearch.time Ago. Category: %predbsearch.catl %predbsearch.cat Group: %predbsearch.grpl %predbsearch.grp Title: %predbsearch.rls $+(https://predb.org/post/,%predbsearch.id,/)
    .timerendpredb 1 5 endpredb
  }
}

on *:SOCKREAD:predbrecent: {
  var %predb
  sockread %predb
  if (*tr class="post" id=* iswm %predb) { set %predbrecent.id $gettok(%predb,4,34) }
  if (*td class="pretime"* iswm %predb) { set %predbrecent.time $gettok($gettok(%predb,2,62),1,60) }
  if (*td class="cat"* iswm %predb) { set %predbrecent.catl $+(www.predb.org,$gettok(%predb,4,34)) | set %predbrecent.cat $gettok(%predb,6,34) }
  if (*td class="grp"* iswm %predb) { set %predbrecent.grpl $+(www.predb.org,$gettok(%predb,4,34)) | set %predbrecent.grp $gettok(%predb,6,34) }
  if (*td class="rls"* iswm %predb) { 
    .timerendpredb off
    set %predbrecent.rls $gettok(%predb,6,34)
    inc %predbrecent.resc 2
    $+(.timerpredbrecent,%predbrecent.resc) 1 %predbrecent.resc msg %predbrecent.chan %predbrecent.time Ago. Category: %predbrecent.catl %predbrecent.cat Group: %predbrecent.grpl %predbrecent.grp Title: %predbrecent.rls $+(https://predb.org/post/,%predbrecent.id,/)
    if ($calc(%predbrecent.resc / 2) == %predbrecent.num) { .timerendpredbrecent off | endpredbrecent }
    .timerendpredbrecent 1 5 endpredbrecent
  }
}

alias predbch { 
  return YOUR_CHAN(s)_HERE 
  ;;seperate multiple channels with a comma -> , (e.g #Home,#chat,#cafe)
}

alias endpredb { sockclose predbsearch | unset %predbsearch.* }
alias endpredbrecent { sockclose predbrecent | unset %predbrecent.* }

;;; Scipted by OrFeAsGr http://mirc-land.tk - Support my art work: http://orpheusgr.tk ;;;

Comments

Sign in to comment.
ovelayer   -  Apr 15, 2017

hey OrFeAsGr awsome script!
was wondering if you could add acouple things??
a command of !pre that will display 20 of the most recent pre's
and !nuked which witll display 20 of the most recent nuked releases
this would be a very good addition to this script
thanks for you hard work and staying involved!!

edit:
i guess predb doesnt show a nuked release but the other command would still be good.
;)

fastjoy77  -  May 05, 2017

search not work

:(

Sign in to comment

OrFeAsGr   -  Mar 03, 2017

v0.2 04/03/2017 Added search command: !presearch page search-term (page can be a number from 1 to 10)
Added !prestop to stop the results from being sent

fastjoy77  -  Mar 04, 2017

:) Very Good

OrFeAsGr  -  May 27, 2017

hi overlayer! I added what you asked! Thx for requesting! I haven't been scripting much lately. Focusing on art :)

Sign in to comment

fastjoy77   -  Feb 28, 2017

Work 100%
it would be nice if it also makes the search for release

OrFeAsGr  -  Feb 28, 2017

Hi! Do you mean search through that list for a specific release or search for that title elsewhere???

fastjoy77  -  Mar 01, 2017

search a specific release

http://hawkee.com/snippet/9660/

OrFeAsGr  -  Mar 03, 2017

Hey man, i added a search command! Check it out!

Nicky337  -  Mar 10, 2017

Would you like to get one more great blog? If your answer yes and you need even more related helpful articles, visit http://goldessayclub.com/

fastjoy77  -  Mar 11, 2017

it's possible add double search?

type : !pre xvid english

OrFeAsGr  -  Mar 12, 2017

yeah it is, i'll add it out soon

fastjoy77  -  Mar 16, 2017

search no works :(

fastjoy77  -  Mar 28, 2017

OrFeAsGr search dont' work

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.