egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Qur'an And Hadeeth Script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Hesham
Voice


Joined: 30 Jun 2007
Posts: 6

PostPosted: Sat Sep 08, 2007 3:46 am    Post subject: Qur'an And Hadeeth Script Reply with quote

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

Thanks
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Sep 08, 2007 3:55 am    Post subject: Reply with quote

Search the Tcl Archive for a random quotes/messages script and replace the messages with the Ayat or Hadeeth.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Hesham
Voice


Joined: 30 Jun 2007
Posts: 6

PostPosted: Sat Sep 08, 2007 3:58 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Sep 08, 2007 6:08 pm    Post subject: Reply with quote

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.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Sun Sep 09, 2007 6:05 am    Post subject: Reply with quote

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*...
Back to top
View user's profile Send private message Visit poster's website
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Sep 09, 2007 1:56 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Sun Sep 09, 2007 4:25 pm    Post subject: Reply with quote

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:
####################################################
#                      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
_________________
|AmDeAtH @ Undernet


Death is only the *Beginning*...


Last edited by iamdeath on Mon Sep 10, 2007 8:15 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
ZEXEL
Halfop


Joined: 27 Jun 2006
Posts: 45

PostPosted: Mon Sep 10, 2007 10:33 am    Post subject: woow! Reply with quote

@iamdeath thx bro, now i've found it! Wink
_________________
.:[ Knowledge Is The Power ]:.
Back to top
View user's profile Send private message Visit poster's website
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Tue Sep 11, 2007 4:15 am    Post subject: Reply with quote

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.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Tue Sep 11, 2007 1:46 pm    Post subject: Reply with quote

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*...
Back to top
View user's profile Send private message Visit poster's website
abah
Halfop


Joined: 01 Dec 2013
Posts: 61
Location: Indonesia

PostPosted: Tue Dec 02, 2014 4:30 am    Post subject: Reply with quote

link is broken please updated link
i needed tcl that Crying or Very sad
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber