WhatPulse Forums » Support » Client software v » New Eggdrop-TCL Script please!!!! Welcome back, Guest.


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New Eggdrop-TCL Script please!!!!
02-02-2009, 05:03 PM
Post: #1
New Eggdrop-TCL Script please!!!!
I´m searching the hole internet for a good Whatpulse-TCL-Script,
but they all broken.

Can somebody please code a new one :confused: :smile:
Find all posts by this user
Quote this message in a reply
02-02-2009, 08:50 PM
Post: #2
New Eggdrop-TCL Script please!!!!
I'm the only one that codes TCL around here, and I've just not had time to do it. ETA on when it'll be done? Never know.

~Century0
Find all posts by this user
Quote this message in a reply
02-02-2009, 09:23 PM (This post was last modified: 02-03-2009 06:08 PM by X-Kal.)
Post: #3
New Eggdrop-TCL Script please!!!!
Ok i tried it myself but i got an error can you take a look @ its a very simple tcl.

It only reads from the users profile page

Code:
<dl class="userstatswrap">

            <dt>User:</dt>
            <dd>VirusZero</dd>
            <dt>Keys:</dt>
            <dd>2,929</dd>
            <dt>Clicks:</dt>
            <dd>1,047</dd>

            <dt>Miles:</dt>
            <dd>0.10</dd>
        </dl>

Here is my Script

Code:
bind pub -|- !pulse whatpulse

package require http

proc whatpulse { nick uhost handle chan text } {
global whatpulse

set connection [http::config -useragent "Mozilla 4.0"]
catch {set connection [http::geturl http://whatpulse.org/stats/users/$text -timeout 3000]} error

set data [http::data $connection]
http::cleanup $connection

regexp -- {^.*?<dl class="userstatswrap"><dt>(.*?)</dt><dd>(.*?)</dd><dt>(.*?)</dt><dd>(.*?)</dd><dt>(.*?)</dt><dd>(.*?)</dd><dt>(.*?)</dt><dd>(.*?)</dd></dl>} $data -> tabelle1

putquick "PRIVMSG $chan :$tabelle1"

}

The TCL error is

Code:
Tcl error [whatpulse]: can't read "tabelle1": no such variable

please fix it ^^


edit : fixed it myself

laterz i post the hole script now it reads from the api
Find all posts by this user
Quote this message in a reply
02-02-2009, 11:39 PM (This post was last modified: 02-03-2009 06:09 PM by X-Kal.)
Post: #4
New Eggdrop-TCL Script please!!!!
Here is my Script its very very simple but it runs

Syntax: !pulse USERID

Code:
bind pub -|- !pulse whatpulse

package require http

proc whatpulse { nick uhost handle chan text } {
global whatpulse

set connection [http::config -useragent "Mozilla 4.0"]
catch {set connection [http::geturl http://whatpulse.org/api/user.php?UserID=$text -timeout 3000]} error

set data [http::data $connection]
http::cleanup $connection

regexp -- {^.*?<UserStats>(.*?)</UserStats>} $data -> tabelle1

regexp -- {^.*?<AccountName>(.*?)</AccountName>} $tabelle1 -> post1

regexp -- {^.*?<Country>(.*?)</Country>} $tabelle1 -> post2

regexp -- {^.*?<DateJoined>(.*?)</DateJoined>} $tabelle1 -> post3

regexp -- {^.*?<TotalKeyCount>(.*?)</TotalKeyCount>} $tabelle1 -> post4

regexp -- {^.*?<TotalMouseClicks>(.*?)</TotalMouseClicks>} $tabelle1 -> post5

regexp -- {^.*?<TotalMiles>(.*?)</TotalMiles>} $tabelle1 -> post6

regexp -- {^.*?<Rank>(.*?)</Rank>} $tabelle1 -> post7

regexp -- {^.*?<TeamName>(.*?)</TeamName>} $tabelle1 -> post8

regexp -- {^.*?<TeamMembers>(.*?)</TeamMembers>} $tabelle1 -> post9

regexp -- {^.*?<TeamKeys>(.*?)</TeamKeys>} $tabelle1 -> post10

regexp -- {^.*?<TeamClicks>(.*?)</TeamClicks>} $tabelle1 -> post11

regexp -- {^.*?<TeamMiles>(.*?)</TeamMiles>} $tabelle1 -> post12

regexp -- {^.*?<TeamRank>(.*?)</TeamRank>} $tabelle1 -> post13


putquick "PRIVMSG $chan : AccountName: $post1"
putquick "PRIVMSG $chan : Country: $post2"
putquick "PRIVMSG $chan : DateJoined: $post3"
putquick "PRIVMSG $chan : TotalKeyCount: $post4"
putquick "PRIVMSG $chan : TotalMouseClicks: $post5"
putquick "PRIVMSG $chan : TotalMiles: $post6"
putquick "PRIVMSG $chan : Rank: $post7"
putquick "PRIVMSG $chan : TeamName: $post8"
putquick "PRIVMSG $chan : TeamMembers: $post9"
putquick "PRIVMSG $chan : TeamKeys: $post10"
putquick "PRIVMSG $chan : TeamClicks: $post11"
putquick "PRIVMSG $chan : TeamMiles: $post12"
putquick "PRIVMSG $chan : TeamRank: $post13"

}

putlog "Whatpulse.by.Viruszero"



please change the xx from http::geturl because i´m not allowed to post url befor i have 15 posts ^^
Find all posts by this user
Quote this message in a reply
02-03-2009, 06:09 PM
Post: #5
New Eggdrop-TCL Script please!!!!
I think I got the link fixed - let me know if I messed it up.

~ X

P.S: Sadly, I don't know anything about TCL script, so I can't be of much help here.

[Image: XKalSig1.png]
Visit this user's website Find all posts by this user
Quote this message in a reply
02-03-2009, 09:13 PM
Post: #6
New Eggdrop-TCL Script please!!!!
X-Kal Wrote:I think I got the link fixed - let me know if I messed it up.

~ X

P.S: Sadly, I don't know anything about TCL script, so I can't be of much help here.

Looks fine to me. His script is fine, granted it's very spammy. I may go and code a more customizable one later.

~Century0
Find all posts by this user
Quote this message in a reply
02-09-2009, 05:34 PM
Post: #7
New Eggdrop-TCL Script please!!!!
I have a littel Update

Now u can search for Teams or put the TeamID in the Script.

Code:
TeamID=$text or TeamID=ID

catch {set connection [http::geturl hxxp://whatpulse.org/api/team.php?TeamID=$text -timeout 3000]} error

Code:
bind pub -|- !upulse upulse
bind pub -|- !tpulse tpulse

package require http

proc upulse { nick uhost handle chan text } {
global upulse

if {$text == ""} {
   putserv "PRIVMSG $chan :$nick - Syntax is !upulse UserID"
   return 0
}

set connection [http::config -useragent "Mozilla 4.0"]
catch {set connection [http::geturl hxxp://whatpulse.org/api/user.php?UserID=$text -timeout 3000]} error

set data [http::data $connection]
http::cleanup $connection

regexp -- {^.*?<UserStats>(.*?)</UserStats>} $data -> tabelle1

regexp -- {^.*?<AccountName>(.*?)</AccountName>} $tabelle1 -> post1
regexp -- {^.*?<DateJoined>(.*?)</DateJoined>} $tabelle1 -> post2
regexp -- {^.*?<TotalKeyCount>(.*?)</TotalKeyCount>} $tabelle1 -> post3
regexp -- {^.*?<TotalMouseClicks>(.*?)</TotalMouseClicks>} $tabelle1 -> post4
regexp -- {^.*?<TotalMiles>(.*?)</TotalMiles>} $tabelle1 -> post5
regexp -- {^.*?<Rank>(.*?)</Rank>} $tabelle1 -> post6
regexp -- {^.*?<RankInTeam>(.*?)</RankInTeam>} $tabelle1 -> post7
regexp -- {^.*?<LastPulse>(.*?)</LastPulse>} $tabelle1 -> post8
regexp -- {^.*?<Pulses>(.*?)</Pulses>} $tabelle1 -> post9

putnow "PRIVMSG $chan : AccountName: $post1"
putnow "PRIVMSG $chan : DateJoined: $post2"
putnow "PRIVMSG $chan : TotalKeyCount: $post3"
putnow "PRIVMSG $chan : TotalMouseClicks: $post4"
putnow "PRIVMSG $chan : TotalMiles: $post5"
putnow "PRIVMSG $chan : TotalRank: $post6"
putnow "PRIVMSG $chan : RankInTeam: $post7"
putnow "PRIVMSG $chan : LastPulse: $post8"
putnow "PRIVMSG $chan : TotalPulses: $post9"

}

proc tpulse { nick uhost handle chan text} {
global tpulse

set connection [http::config -useragent "Mozilla 4.0"]
catch {set connection [http::geturl hxxp://whatpulse.org/api/team.php?TeamID=$text -timeout 3000]} error

set data [http::data $connection]
http::cleanup $connection

regexp -- {^.*?<WhatPulse>(.*?)</WhatPulse>} $data -> haupt1
regexp -- {^.*?<Statistics>(.*?)</Statistics>} $haupt1 -> stats

regexp -- {^.*?<TeamName>(.*?)</TeamName>} $stats -> link1
regexp -- {^.*?<TeamDescription>(.*?)</TeamDescription>} $stats -> link2
regexp -- {^.*?<TeamMembers>(.*?)</TeamMembers>} $stats -> link3
regexp -- {^.*?<TeamKeys>(.*?)</TeamKeys>} $stats -> link4
regexp -- {^.*?<TeamClicks>(.*?)</TeamClicks>} $stats -> link5
regexp -- {^.*?<TeamMiles>(.*?)</TeamMiles>} $stats -> link6
regexp -- {^.*?<TeamRank>(.*?)</TeamRank>} $stats -> link7
regexp -- {^.*?<TeamDateFormed>(.*?)</TeamDateFormed>} $stats -> link8

putnow "PRIVMSG $chan : TeamName: $link1"
putnow "PRIVMSG $chan : TeamDescription: $link2"
putnow "PRIVMSG $chan : TeamMembers: $link3"
putnow "PRIVMSG $chan : TeamKeys: $link4"
putnow "PRIVMSG $chan : TeamClicks: $link5"
putnow "PRIVMSG $chan : TeamMiles: $link6"
putnow "PRIVMSG $chan : TeamRank: $link7"
putnow "PRIVMSG $chan : TeamDateFormed: $link8"
}

putlog "7Whatpulse.by.VirusZero"
Find all posts by this user
Quote this message in a reply
10-28-2009, 06:05 PM
Post: #8
New Eggdrop-TCL Script please!!!!
I use my own Script for getting Data from whatpulse.
Code:
package require http
bind pub - ?whatpulse L:whatpulse
proc L:whatpulse {nick host hand chan arg} {
    set connection [http::config -useragent "Mozilla 4.0"]
    catch {set connection [http::geturl XXXX://whatpulse.org/stats/users/[lindex $arg 0]/ -timeout 3000]} error
    set wpdata [http::data $connection]
    http::cleanup $connection

    regexp {(?i)has been a participant since(.*?)users to WhatPulse.} $wpdata -> wp(readout)
    regexp {(?i)This user is in team(.*?)in that team.} $wpdata -> wp(readteam)
    if {[info exists wp(readteam)]} { regexp {(?i)target="_blank" rel="nofollow">(.*?)</a>} $wp(readteam) -> wp(team); set wp(teamrank) [lindex $wp(readteam) 7] }

## Design Variables for Channel-Output
    set wp(nick)             [lindex $arg 0]
    set wp(keys)             [lindex $wp(readout) 10]
    set wp(clicks)         [lindex $wp(readout) 13]
    set wp(mouse_miles)         [lindex $wp(readout) 22]
    set wp(keys_per_sec)     [lindex $wp(readout) 25]
    set wp(clicks_per_sec)     [lindex $wp(readout) 28]
    set wp(lastpulse_date)     [lindex $wp(readout) 42]
    set wp(lastpulse_time)     [lindex $wp(readout) 43]
    set wp(number_of_pulses)     [lindex $wp(readout) 50]
    set wp(country)         [lindex $wp(readout) 56]
    set wp(refered_users)     [lindex $wp(readout) 60]
    # $wp(team)         -> ->    contains the teamname - if user is in an team
    # $wp(teamrank)     -> ->    contains the rank in team - if user is in an team

## Bugfixing
    if {$wp(country) == "United"} { $wp(country) == "United States" }

## Channel-Output
    putserv "privmsg $chan :«Whatpulse» $wp(nick) ($wp(country)) hat $wp(keys) gezählte Tastenanschläge und $wp(clicks) Mausklicks. (Last Pulse: $wp(lastpulse_date) um $wp(lastpulse_time) Uhr)"
    if {[info exists wp(team)]} {
        ##INFO## this line will only be executed if the user is in an team.
        putserv "privmsg $chan :«Whatpulse» $wp(nick) ist im Team $wp(team) und hat dort den Rang: $wp(teamrank)"
    }
}
putlog "Whatpulse-Script by LuZ1 loaded"

the only thing you have to do is change the XXXX in line 5 of this script to http (board restrictions for urls ^^)

is dont use the given api for getting information, because i dont want to search an userid - i want to search an nickname
currently the script is in german - but its easy to translate - just use the vars and layout it yourself.

see it work:
Quote:«18:53:55» <@LuZ1F3R> ?whatpulse LuZ1F3R
«18:53:56» <@Zwergnase> «Whatpulse» LuZ1F3R (Germany.) hat 13,712,854 gezählte Tastenanschläge und 4,946,254 Mausklicks. (Last Pulse: 2009-10-28 um 17:04:33 Uhr)
«18:53:57» <@Zwergnase> «Whatpulse» LuZ1F3R ist im Team #t2f-palace und hat dort den Rang: 2nd
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [SOLVED] .sh permissions script fatsa 4 1,877 08-04-2015 12:02 AM
Last Post: LukeLR
  script to check if running or not Sc0rian 0 1,983 07-09-2013 02:00 PM
Last Post: Sc0rian
  Change to setup script austinmarton 3 2,148 04-08-2011 04:53 PM
Last Post: hostname
  mIRC 7.1 and mIRC script Tzan 6 6,265 09-11-2010 04:47 PM
Last Post: Tzan

Forum Jump:


User(s) browsing this thread: 1 Guest(s)