This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Qur'an And Hadeeth Script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
H
Hesham
Voice
Posts: 6
Joined: Sat Jun 30, 2007 10:00 pm

Qur'an And Hadeeth Script

Post by Hesham »

Hello..
need a script for eggdrop that sends random ayat of Quran or Hadeeth to the channel

Thanks
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Search the Tcl Archive for a random quotes/messages script and replace the messages with the Ayat or Hadeeth.
H
Hesham
Voice
Posts: 6
Joined: Sat Jun 30, 2007 10:00 pm

Post by Hesham »

good idea i was thinking about that.. but still need a source { perfect source } of ayat & hadeeth .. do you know any source that can be readable by script?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

It's your job to find a source. If you're talking about a web page, then you'll need to find a site and ask for someone to write a script to parse it.
User avatar
iamdeath
Master
Posts: 323
Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:

Post by iamdeath »

I once wrote a script for Quran, I will go through my older hard disk and let you know if I still have it. You may need to wait a few days.

Thanks
iamdeath
|AmDeAtH @ Undernet
Death is only the *Beginning*...
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

The script is the easy part.. Finding a suitable data source is the real trick. There's an existing bible script in the archive, that uses data from ebible.org's downloadable text file version. Find a data source, whether a text file or a website, and we can easily make a script for it.
User avatar
iamdeath
Master
Posts: 323
Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:

Post by iamdeath »

This script was basically written by one of my friend and me on the request of #karachi channel @ Undernet. It's old I am not sure neither I gurantee will work or not, I don't have time to fix it either, if other legendary coders can take out their precious time for you to fix it then it's upto you. I searched for this TCL and the source and I uploaded it for you.

Code: Select all

####################################################
#                      Quran                       #
####################################################


### Variables
set quran(interval) "2"
set quran(intervall) "20"
set quran(characters) "190"
set quran(database.txt) "tmp/Quran.txt"
 

### Events
bind pub - "!quran" quran:proc
bind pub - "!autoplay" autoplay:proc


### Commands
proc quran:proc {nick uhost handle chan text} {
  global quran

  if {[lindex [split "$text" ":"] 0] != "" && [lindex [split "$text" ":"] 1] != ""} {

    if {[file exists "$quran(database.txt)"] == "1"} {
      set quran(found) "NO"
      set txt "[open "$quran(database.txt)" r]"

      for {set x 0} {![eof $txt]} {incr x} {
        gets $txt line
        if {[lindex [split "$text" ":"] 0] == [lindex [split $line ":"] 1] && [lindex [split "$text" ":"] 1] == [lindex [split $line ":"] 2]} {
          set quran(found) "YES"
          set line "[lindex [split $line "¤"] 0]"
          if {[string length "$line"] > "200"} { quran:divide $nick $chan $line } else { puthelp "PRIVMSG $chan :[lindex "$line" 0] [lrange "$line" 1 end]" }
          break
        }
      }

      if {$quran(found) == "NO"} { puthelp "PRIVMSG $chan :INVALID ENTRY: Retry!" }
      close $txt
    } else { putlog "ERROR: File \"$quran(database.txt)\" not found!" }

  } else { puthelp "PRIVMSG $chan :Use: !quran <Surah>:<Ayat>" }
}

proc quran:divide {nick chan text} {
  global quran

  set word "1"
  set sentence "1"

  while {$sentence <= [expr [string length "$text"] / $quran(characters)]} {
    set line "[lindex "$text" $word]"
    while {$word < "2000"} {
      incr word
      set line "$line [lindex "$text" $word]"
      if {[string length "$line"] > "$quran(characters)"} { utimer [expr $sentence * $quran(interval)] "puthelp {PRIVMSG $chan :[lindex "$text" 0] $line}" ; break }
    }
    incr word
    incr sentence
  }

  if {[lrange "$text" $word end] != ""} { utimer [expr $sentence * $quran(interval)] "puthelp {PRIVMSG $chan :[lindex "$text" 0] [lrange "$text" $word end]}" }
}

proc autoplay:proc {nick uhost handle chan text} {
  global quran

  if {[isop $nick $chan] || [isvoice $nick $chan]} {

    if {$text != ""} {

      if {$text == "stop"} {
        foreach utimer [utimers] { if {[string match "*quran:proc *" $utimer]} { killutimer [lindex $utimer end] } }
        puthelp "PRIVMSG $chan :All TIMERS stopped!"
      } else {

        foreach utimer [utimers] { if {[string match "*quran:proc *" $utimer]} { puthelp "PRIVMSG $chan :Busy: Retry later!" ; return 0 } }

        if {[file exists "$quran(database.txt)"] == "1"} {
          set t "0"
          set quran(found) "NO"
          set txt "[open "$quran(database.txt)" r]"

          for {set x 0} {![eof $txt]} {incr x} {
            gets $txt line
            if {$text == [lindex [split $line ":"] 1]} {
              set quran(found) "YES"
              utimer [expr $t * $quran(intervall)] "quran:proc $nick $uhost $handle $chan [lindex [split $line ":"] 1]:[lindex [split $line ":"] 2]"
              incr t
            }
          }

          if {$quran(found) == "NO"} { puthelp "PRIVMSG $chan :INVALID ENTRY: Retry!" }
          close $txt
        } else { putlog "ERROR: File \"$quran(database.txt)\" not found!" }

      }

    } else { puthelp "PRIVMSG $chan :Use: !autoplay <Surah>" }

  }
}


putlog "TCL Quran.tcl Loaded!"
And here is the link of Quran Source.

Complete Holy QURAN & Quran.tcl

Thanks
iamdeath
Last edited by iamdeath on Mon Sep 10, 2007 8:15 am, edited 2 times in total.
|AmDeAtH @ Undernet
Death is only the *Beginning*...
User avatar
ZEXEL
Halfop
Posts: 45
Joined: Tue Jun 27, 2006 10:47 pm
Contact:

woow!

Post by ZEXEL »

@iamdeath thx bro, now i've found it! :wink:
.:[ Knowledge Is The Power ]:.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

This script is a normal script saying out random lines at different intervals and reads a database from the text file @ "tmp/Quran.txt"

So basically Hesham, you have to build your own database (if you cannot find an archive online) and the rest you can use this script (rather obsolete and too over complicated though) display your ayat and hadeeth lines from quran on your channels.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
iamdeath
Master
Posts: 323
Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:

Post by iamdeath »

awyeah wrote:This script is a normal script saying out random lines at different intervals and reads a database from the text file @ "tmp/Quran.txt"

So basically Hesham, you have to build your own database (if you cannot find an archive online) and the rest you can use this script (rather obsolete and too over complicated though) display your ayat and hadeeth lines from quran on your channels.
I have already uploaded the Database see the link please. Database means the whole Quran, which is not easy to write.

http://love.musicpk.com/Quran.zip

It contains Qurant.txt and the TCL.
|AmDeAtH @ Undernet
Death is only the *Beginning*...
User avatar
abah
Halfop
Posts: 62
Joined: Sun Dec 01, 2013 3:04 am
Location: Indonesia

Post by abah »

link is broken please updated link
i needed tcl that :cry:
Post Reply