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.

Birdy (OAuth, Twitter, Tweets&MegaHAL v6.01d) Jun12,2013

Support & discussion of released scripts, and announcements of new releases.
Post Reply
M
ManNose
Voice
Posts: 9
Joined: Sat Sep 01, 2012 2:24 am

Post by ManNose »

Does anyone have a good, understandable guide for installing MegaHAL? I have been looking through the internet, its very hard to understand and find a guide of how installing this module properly
User avatar
heartbroken
Op
Posts: 110
Joined: Thu Jun 23, 2011 11:15 pm
Location: somewhere out there

Post by heartbroken »

hi ..
untar Barker.jr's megaHAL tar ball into eggdrop1.6.21/src/mod/
tar -xvjf megahal.mod.2.7.tar.bz2
and go back into eggdrop1.6.21 main directory.and compile with:
./configure
make config or make iconfig
make and make install DEST=/home/name/your-new-eggdrop
megaHAL has two remote scripts copy them into your new eggdrop/scripts directory with:
cp ~/eggdrop1.6.21/src/mod/megahal.mod/examples/respnickanywhere.tcl ~/your-new-bot/scripts/

cp ~/eggdrop1.6.21/src/mod/megahal.mod/examples/replyall.tcl ~/your-new-bot/scripts/

go into your new-eggdrop edit your new eggdrop.conf file .add two lines for these scripts like
source scripts/replyall.tcl
source scripts/respnickanywhere.tcl

and add a line for megahal modüle:
loadmodule megahal
start your new bot with : ./eggdrop -m eggdrop.conf
when your bot joins in introduce yourself to the bot /msg bot-nick hello and than /msg bot-nick pass your-pass
when you have join in partyline (telnet/dcc comminication with your eggdrop) type .chanset #channel-name +megahal for to activate megahal on your channel.
i don't suggest you to activate +learnall or +freespeak settings..thats it.good luck :)
Life iS Just a dReaM oN tHE wAy to DeaTh
M
ManNose
Voice
Posts: 9
Joined: Sat Sep 01, 2012 2:24 am

Post by ManNose »

Can you link me to the script?
User avatar
heartbroken
Op
Posts: 110
Joined: Thu Jun 23, 2011 11:15 pm
Location: somewhere out there

Post by heartbroken »

i removed file
Last edited by heartbroken on Wed Sep 26, 2012 12:28 pm, edited 2 times in total.
Life iS Just a dReaM oN tHE wAy to DeaTh
M
ManNose
Voice
Posts: 9
Joined: Sat Sep 01, 2012 2:24 am

Post by ManNose »

hey, thanks for that - it works!

I have a problem though, the settings is to -freespeak

but he speaks all the time nonetheless.. why???
User avatar
heartbroken
Op
Posts: 110
Joined: Thu Jun 23, 2011 11:15 pm
Location: somewhere out there

Post by heartbroken »

well this is wierd. cus i already have an eggdrop its been running with megahal+birdy and settings are +megahal -learnall -freespeak and with these settings bot only responce when someone mention it bot's nick like hey bot-nick wass up etc..bot only answer these.otherwise nprmaly it shouldnt .. so i dont know why your bot acting like that...
Life iS Just a dReaM oN tHE wAy to DeaTh
User avatar
Ankara
Voice
Posts: 2
Joined: Sat Oct 13, 2012 4:33 pm

Post by Ankara »

Looks like those wonderful new features are beginning to be implemented over at twitter. </sarcasm>

I see this now when my bot tries to update to twitter:

Code: Select all

<botname>  OAuth failed: (404) that page does not exist</error> </errors>; <?xml version=1.0 encoding=utf-8?> <errors> <error code=34>sorry ( ok )
then followed by:

Code: Select all

<botname> (Megahal) Botname replied to (twittername) accounts.]
It still seems to be working however, as my bot is answering people.
I believe this is due to one of the *special* changes they had planned for us evil app users.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Ankara wrote:Looks like those wonderful new features are beginning to be implemented over at twitter. </sarcasm>

I see this now when my bot tries to update to twitter:

Code: Select all

<botname>  OAuth failed: (404) that page does not exist</error> </errors>; <?xml version=1.0 encoding=utf-8?> <errors> <error code=34>sorry ( ok )
then followed by:

Code: Select all

<botname> (Megahal) Botname replied to (twittername) accounts.]
It still seems to be working however, as my bot is answering people.
I believe this is due to one of the *special* changes they had planned for us evil app users.
Partly their fault, partly mine. All endpoints using twitter.com directly can no longer be used for API requests. (WHY?: This stops alot of spam bots and link harvesting bots.) This was my fault, because this was told to developers a long time ago, it's just that twitter never really "enforced" that policy until now, so why fix what isn't broken I never updated all the url's to compliance... oops

You can fix it by making sure ALL url's in the (# 2) --> URLS <--) section of the config are changed from:

Code: Select all

set twitter(userxml) "http://twitter.com/statuses/user_timeline.xml"
set twitter(home) "http://twitter.com/statuses/home_timeline.json"
set twitter(mention) "http://twitter.com/statuses/mentions.json"
set twitter(mentionxml) "http://twitter.com/statuses/mentions.xml"
And modified to look like they are below instead:

Code: Select all

set twitter(userxml) "http://api.twitter.com/1/statuses/user_timeline.xml"
set twitter(home) "http://api.twitter.com/1/statuses/home_timeline.json"
set twitter(mention) "http://api.twitter.com/1/statuses/mentions.json"
set twitter(mentionxml) "http://api.twitter.com/1/statuses/mentions.xml"
The API end-point of twitter.com must now be used for all requests and this is now enforced. This will stop the recurring 404 and page does not exist error from happening.

There will be a new version released soon that includes some bug-fixes, and other minor fixes. It will also make it easier to port to v1.1 of their API which I do intend on doing. So the script won't die per say... Perhaps I over exaggerated a bit. ;)
B
BigToe
Halfop
Posts: 99
Joined: Thu Dec 30, 2010 4:49 pm

Post by BigToe »

Hello

Can this script be modified so instead of displaying the tweets to the channel it will write down the tweets to a .txt file?
B
BigToe
Halfop
Posts: 99
Joined: Thu Dec 30, 2010 4:49 pm

Post by BigToe »

Is that a no?
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

BigToe wrote:Is that a no?
Bro, I never saw the original post asking for help here. Assume we are all human and pobody is nerfect... Everything is possible, until it is attempted. At which point maybe something becomes impossible. So lets attempt...

Code: Select all

					if {[string equal -nocase "friends" $type]} {
						if {($twitter($tuser,lastidf) < $id && ![string equal -nocase $screen $tuser]) || ($twitter($tuser,lastidf) == $id && [info exists sp] && ![string equal -nocase $screen $tuser])} {
							if {![info exists skip]} {
								putserv "$to :$tt" ; set sp 0
							}
							if {![info exists pure]} {
								set twitter($tuser,lastidf) $id
								set pure 0
							}
						}
					} else {
Find that chunk, and make that chunk into something like it is below...

Code: Select all

					if {[string equal -nocase "friends" $type]} {
						if {($twitter($tuser,lastidf) < $id && ![string equal -nocase $screen $tuser]) || ($twitter($tuser,lastidf) == $id && [info exists sp] && ![string equal -nocase $screen $tuser])} {
							if {![info exists skip]} {
								if {![file exists "twitter-friends-$chan.txt"]} {
									set file [open "twitter-friends-$chan.txt" w]
								} else {
									set file [open "twitter-friends-$chan.txt" a]
								}
								puts $file $tt ; set sp 0 ; close $file
							}
							if {![info exists pure]} {
								set twitter($tuser,lastidf) $id
								set pure 0
							}
						}
					} else {
Make sure to disable \n newlines in tweets (the option to do this is in the config) when using this hack. This will save all the "friends" automations. This isn't a perfect hack either. This open/closes the file several times in a row, which should be fine. But isn't the most economical solution. I have to rewrite this script to support v1.1 of twitter's oauth by march 21st or it will entirely die. So when spending time on birdy my focus will be on this goal rather than adding features. If you need @mentions hacked in to save to a file too, let me know.
B
BigToe
Halfop
Posts: 99
Joined: Thu Dec 30, 2010 4:49 pm

Post by BigToe »

Thank you speechles, I will give it a try and see how it works - i will keep you posted.


I do not need the same feature for @Mentions, thanks.


What kind of new features were you thinking to add?
B
BigToe
Halfop
Posts: 99
Joined: Thu Dec 30, 2010 4:49 pm

Post by BigToe »

It worked speechles
B
BigToe
Halfop
Posts: 99
Joined: Thu Dec 30, 2010 4:49 pm

Post by BigToe »

speechles wrote:
BigToe wrote:Is that a no?
Bro, I never saw the original post asking for help here. Assume we are all human and pobody is nerfect... Everything is possible, until it is attempted. At which point maybe something becomes impossible. So lets attempt...

Code: Select all

					if {[string equal -nocase "friends" $type]} {
						if {($twitter($tuser,lastidf) < $id && ![string equal -nocase $screen $tuser]) || ($twitter($tuser,lastidf) == $id && [info exists sp] && ![string equal -nocase $screen $tuser])} {
							if {![info exists skip]} {
								putserv "$to :$tt" ; set sp 0
							}
							if {![info exists pure]} {
								set twitter($tuser,lastidf) $id
								set pure 0
							}
						}
					} else {
Find that chunk, and make that chunk into something like it is below...

Code: Select all

					if {[string equal -nocase "friends" $type]} {
						if {($twitter($tuser,lastidf) < $id && ![string equal -nocase $screen $tuser]) || ($twitter($tuser,lastidf) == $id && [info exists sp] && ![string equal -nocase $screen $tuser])} {
							if {![info exists skip]} {
								if {![file exists "twitter-friends-$chan.txt"]} {
									set file [open "twitter-friends-$chan.txt" w]
								} else {
									set file [open "twitter-friends-$chan.txt" a]
								}
								puts $file $tt ; set sp 0 ; close $file
							}
							if {![info exists pure]} {
								set twitter($tuser,lastidf) $id
								set pure 0
							}
						}
					} else {
Make sure to disable \n newlines in tweets (the option to do this is in the config) when using this hack. This will save all the "friends" automations. This isn't a perfect hack either. This open/closes the file several times in a row, which should be fine. But isn't the most economical solution. I have to rewrite this script to support v1.1 of twitter's oauth by march 21st or it will entirely die. So when spending time on birdy my focus will be on this goal rather than adding features. If you need @mentions hacked in to save to a file too, let me know.

Hey speechles - is it possible to add in addition to this the Date and time the tweet was written to the file at the end of each tweet?
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

BigToe wrote:Hey speechles - is it possible to add in addition to this the Date and time the tweet was written to the file at the end of each tweet?
Sure...

Add this in the config section of the script:

Code: Select all

# Add your timestring which the file saving portion will use
# to create it's timestamps
set twitter(filetimestring) {%Y-%m-%d %I:%M:%S%p} 
Then change the code to what it looks like below:

Code: Select all

              if {[string equal -nocase "friends" $type]} {
                  if {($twitter($tuser,lastidf) < $id && ![string equal -nocase $screen $tuser]) || ($twitter($tuser,lastidf) == $id && [info exists sp] && ![string equal -nocase $screen $tuser])} {
                     if {![info exists skip]} {
                        if {![file exists "twitter-friends-$chan.txt"]} {
                           set file [open "twitter-friends-$chan.txt" w]
                        } else {
                           set file [open "twitter-friends-$chan.txt" a]
                        }
                        puts $file "[clock format [clock seconds] -format $::twitter(filetimestring)] $tt" ; set sp 0 ; close $file
                     }
                     if {![info exists pure]} {
                        set twitter($tuser,lastidf) $id
                        set pure 0
                     }
                  }
               } else {
Post Reply