It should output the Playerinfos from www.nollex.de in the Channel when its called with e.g."user_search 3 micromaster".
Its for a Browsergame called ogame (www.ogame.de)
I´m really new to this Eggdrop/tcl stuff, would be really kind if someone could help me bit out

Heres the script:
Code: Select all
proc user_search {mode args} {
if {![regexp {\A[123]{1}\Z} $mode]} {error "Error: Mode has to be 1, 2 or 3. (Not \"$mode\"!)"}
package require http
foreach char [split $args {}] { append keyword %[format %x [scan $char %c]] }
set string [::http::data [::http::geturl http://www.nollex.de/ogame/se_uni1.php?cmbAllyPlayer=Player&txtSuchen=$keyword]]
regexp {..:: punkte ::..(.*)..:: forschung ::..(.*)..:: flotte ::..(.*)\Z} $string -> data(1) data(2) data(3)
set string $data($mode)
set output {}
while {[regexp {<tr[^>]*><[^>]*><[^>]*>([^<]+)<[^>]*><[^>]*><[^>]*><[^>]*><[^>]*>([^<]+)<[^>]*><[^>]*><[^>]*><[^>]*><[^>]*><[^>]*>([^<]*)<[^>]*><[^>]*><[^>]*><[^>]*><[^>]*>([^<]+)<[^>]*><[^>]*><[^>]*><[^>]*>([^/]+)/([^<]+)<[^>]*><[^>]*>([^<]+)<[^>]*><[^>]*>[^\(]*\(([^%]+)%\)<[^>]*><[^>]*></tr>(.*)} $string -> rank player ally score from to scoregain percent string]} {
append output "$rank / $player / $ally / $score / $from - $to / $scoregain / $percent%\n"
}
return [string trim $output]
The Error message reads:
Thanks for reading, greats AenguishTcl error [user_search]: can't read "data(aenguish)": no such element in array