Bible Passage For Bot

By napa182 on Feb 29, 2008

Ok heres my first attempt at a socket script. I wanted to make something different and i never seen a script like this so I made A Bible Passage Look up. copy and paste in ur own or ur bots remotes. if you load in ur own trigger is /bible john 3 16 or any bible passage for others to trigger it it's !bible john 3 16 or like i said any bible passage.. well enjoy...

on *:text:!bible*:#: {
  if ($3 !isnum) || ($chr(58) isin $3) { 
    msg $chan 14,1[12,1?0,1::Syntax0,1::12,1?14,1]14,1[12,1?0,1:: !bible john 3 16 0,1::12,1?14,1]
  }
  else {
    inc -u15 $+(%,bibleflood,.,$chan,.,$nick)
    if ($($+(%,bibleflood,.,$chan,.,$nick),2) = 3) { $+(.,timerbibleflood,.,$chan,.,$nick) 1 1 msg $chan 14,1[12,1?0,1::Stop Flooding Ignored For A Few Seconds0,1::12,1?14,1] }
    if ($($+(%,bibleflood,.,$chan,.,$nick),2) >= 4) { 
    }
    else {
      if ($sock(bverse)) .sockclose bverse 
      set %verse $2 $+ $chr(43) $+ $3 $+ $chr(37) $+ 3A $+ $4
      set %Book Book $chr(32) :: $2
      set %Chapter Chapter $chr(32) :: $3
      set %chan $chan
      sockopen bverse bibleresources.bible.com 80
    }
  }
}
on *:SOCKOPEN:bverse: {
  sockwrite -nt $sockname GET /passagesearchresults.php?passage1= $+ %verse $+ &version1=9 HTTP/1.1
  sockwrite -nt $sockname Host: bibleresources.bible.com
  sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:bverse: {
  if ($sockerr) {
    msg %chan 14,1[12,1?0,1:: !!Socket Error!! 0,1::12,1?14,1]
  }
  else { 
    var %Bible
    sockread %Bible
    if (*not found* iswm %Bible) {
      msg %chan 14,1[12,1?0,1:: Sorry No Such Bible Passage 0,1::12,1?14,1]
      unset %Book %Chapter %verse %chan
      sockclose bverse
    }
    if (*sup id=* iswm %Bible ) {
      var %passage $htmlfree(%Bible)
      msg %chan 14,1[12,1?0,1:: %Book 0,1::12,1?14,1]14,1[12,1?0,1:: %Chapter 0,1::12,1?14,1]14,1[12,1?0,1:: Verse :: %passage 0,1::12,1?14,1]14,1[12,1?0,1:: Napa182's :: Bible Script 0,1::12,1?14,1]
      unset %Book %Chapter %verse %chan 
      sockclose bverse
    }    
  }
}
on *:load: { 
  echo 12 -a You Have Just Loaded Napa182's Bible Passage Script 
  echo 12 -a A Script0rs Inc. Production 
  echo -a 14,1(14,1?15,1?0,1?0,1? ?ט?Ǯ0??X׻ ?0,1?15,1?14,1?)?
}
alias bible {
  if ($2 !isnum) || ($chr(58) isin $2) {
    echo -a 14,1[12,1?0,1::Syntax0,1::12,1?14,1]14,1[12,1?0,1:: /bible john 3 16 0,1::12,1?14,1]
  }
  else {
    if ($sock(bverse)) .sockclose bverse 
    set %verse $1 $+ $chr(43) $+ $2 $+ $chr(37) $+ 3A $+ $3
    set %Book Book $chr(32) :: $1
    set %Chapter Chapter $chr(32) :: $2
    set %chan $chan
    sockopen bverse bibleresources.bible.com 80
  }
}
alias htmlfree { 
  var %b,%p 
  %p = $regsub($1-,/[^<]*>|<[^>]*>|<[^>]*/g,$chr(32),%b)
  %b = $remove(%b,&nbsp;) 
  return %b 
}

Comments

Sign in to comment.
Almost_Paradise   -  Nov 16, 2020

Not sure what I am not doing right but if user types !bible they get the syntax error stating to use the example given which would be !bible John 3 16 which I have tried many different book calls but nothing happens in channel the Mirc bot then shows in its console Unknown Command. and does this every time i try another except when just typing !bible alone. I know it sees the script because if you just type bible it sends the syntax error to the channel

 Respond  
Almost_Paradise   -  Nov 16, 2020

Not sure what I am not doing right but if user types !bible they get the syntax error stating to use the example given which would be !bible John 3 16 which I have tried many different book calls but nothing happens in channel the Mirc bot then shows in its console Unknown Command. and does this every time i try another except when just typing !bible alone. I know it sees the script because if you just type bible it sends the syntax error to the channel

 Respond  
Almost_Paradise   -  Nov 16, 2020

Not sure what I am not doing right but if user types !bible they get the syntax error stating to use the example given which would be !bible John 3 16 which I have tried many different book calls but nothing happens in channel the Mirc bot then shows in its console Unknown Command. and does this every time i try another except when just typing !bible alone. I know it sees the script because if you just type bible it sends the syntax error to the channel

 Respond  
corey_luke   -  Mar 21, 2010

really nice script! just starting using it. but i'm trying to figure out how to edit the script in such a way it produces other bible versions?

like, !biblekjv !biblenkjv etc. etc. Not everyone can understand KJV.

Need help with that.

 Respond  
napa182   -  Dec 15, 2009

@TheWhistler- Thanks

Clarkcj Said:

Its a nice script. But there is a problem with it, it doesn't have some books like Kings and Esther. 2) I don't think advertising the script by adding to the end of the verse it outputs by adding by napa182's scripts. And the color coding is not great, I think it would look better without the background color and just have text color.

lol such an old script
hmm when you say Kings do you mean 1Kings or 2Kings cuz there is no Kings in the King James Version.

oh and Esther seems to work just fine

<~napa182> @bible Esther 1 1
<&Sick0> [ Passage Esther 1:1: ]
<&Sick0> Now it came to pass in the days of Ahasuerus, (this is Ahasuerus which reigned, from India even unto Ethiopia, over an hundred and seven and twenty provinces:)

anyways here is a fast rewrite with no color and no flood control as well no checks. ;x

on *:text:@bible*:#: {
  if ($sock(bible)) .sockclose bible
  sockopen bible bibleresources.bible.com 80
  sockmark bible # $+($2,$chr(43),$3,$chr(37),3A,$4,&version1=9)
}
on *:sockopen:bible: {
  sockwrite -nt $sockname GET $+(/passagesearchresults.php?passage1=,$gettok($sock(bible).mark,2,32)) HTTP/1.1
  sockwrite -nt $sockname Host: $+(bibleresources.bible.com,$str($crlf,2))
}
on *:sockread:bible: {
  var %bible | sockread %bible
  if ($regex(%bible,/.+(not found).+/)) { msg $gettok($sock(bible).mark,1,32) Passage $regml(1) | sockclose bible }
  if ($regex(%bible,/<b>(.+)<\/b><br>/i)) { msg $gettok($sock(bible).mark,1,32) $chr(91) $regml(1) $chr(93) }
  if ($regex(%bible,/<p \/>.+<sup id=.+<\/sup>(.+)<br><br>/i)) { msg $gettok($sock(bible).mark,1,32) $regml(1) | sockclose bible  }
}
 Respond  
TheWhistler   -  Dec 15, 2009

i dont see any problem with the bible script, i use a black bg on my script and
as for the napa182's scripts being on it just shows u who made the script, Plus
Clarkcj if u know how to edit that part out do so, or the bg color and stop complaining, Napa keep up the good work i give u a 10 on the rateing, even tho i not a scripter.

 Respond  
Clarkcj   -  Dec 14, 2009

Its a nice script. But there is a problem with it, it doesn't have some books like Kings and Esther. 2) I don't think advertising the script by adding to the end of the verse it outputs by adding by napa182's scripts. And the color coding is not great, I think it would look better without the background color and just have text color.

 Respond  
xero_art   -  Feb 08, 2009

thx...though I'll have to edit out the color coding

 Respond  
napa182   -  Feb 29, 2008

thank you ZiX

 Respond  
ZiX   -  Feb 29, 2008

Very Nice Script napa182.

 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.