Once again need a little help with a tcl.
I've tried to do one script that shows the next games that will be released soon, but with no results.
the sourcer is ign.com.
or if someone can find me a tcl more or less like this one i appreciate
I have a few lines of code that might be useful if anyone help me with that.
This is the basic code lol , the "hard code" I was incapable to make something that works
Code: Select all
################################
# UpcomingGames.tcl v1.0 #
################################
## Configuration ##
# Trigger to view upcoming games:
set upgames(show) "!upcoming"
# Trigger to view sections available:
set upgames(view_sections) "!upsections"
# Trigger to view top games:
set upgames(top_games) "!topgames"
# Trigger to view Help:
set upgames(help) "!uphelp"
# Set Tag for sections
# PC GAMES:
set upgames(sect_pc) "PC"
# Playstation 2
set upgames(sect_ps2) "PS2"
# Playstation 3
set upgames(sect_ps3) "PS3"
# Playstation Portable
set upgames(sect_psp) "PSP"
# Xbox
set upgames(sect_xbox) "XBOX"
# Xbox 360
set upgames(sect_x360) "XBOX360"
# Wii
set upgames(sect_wii) "Wii"
# Nintendo DS
set upgames(sect_nds) "NDS"
## End of Configuration ##
## Do Not Edit the code below ##
# Script Version
set uver "1.0"
# IGN url's
set upgames(pcurl) "http://pc.ign.com/index/release.html"
set upgames(ps2url) "http://ps2.ign.com/index/release.html"
set upgames(ps3url) "http://ps3.ign.com/index/release.html"
set upgames(pspurl) "http://psp.ign.com/index/release.html"
set upgames(xboxurl) "http://xbox.ign.com/index/release.html"
set upgames(x360url) "http://xbox360.ign.com/index/release.html"
set upgames(wiiurl) "http://wii.ign.com/index/release.html"
set upgames(ndsurl) "http://ds.ign.com/index/release.html"
set upgames(top_url) "http://games.ign.com/topgames"
# Sections Available:
set upgames(sections) "$upgames(sect_pc) • $upgames(sect_ps2) • $upgames(sect_ps3) • $upgames(sect_psp) • $upgames(sect_xbox) • $upgames(sect_x360) • $upgames(sect_wii) • $upgames(sect_nds) "
bind pub - $upgames(show) show_UpGames
bind pub - $upgames(view_sections) show_sections
bind pub - $upgames(top_games) show_top
bind pub - $upgames(help) show_help
proc show_sections {nick host hand chan arg} {
global upgames
puthelp "PRIVMSG $chan :\00307\[\002\00315Sections:\00300\002 $upgames(sections) \00307\]\ "
}
The Output could be something like this:
[Release date][ Game ][ Genre / Publisher ]
(@me) !upcoming PC
(@Bot) [January 7, 2007][ Heart of Empire: Rome ][ Strategy / Deep Silver ]
.....
...
Code: Select all
proc show_UpGames {nick host hand chan arg} {
global upgames
set url ""
if {[lindex $arg 0] == ""} { puthelp "PRIVMSG $chan :\002Usage\002: $upgames(show) <Section> "
return }
if {[string match -nocase [lindex $arg 0] $upgames(sect_pc)]} { set url $upgames(pcurl) }
if {[string match -nocase [lindex $arg 0] $upgames(sect_ps2)]} { set url $upgames(ps2url) }
if {[string match -nocase [lindex $arg 0] $upgames(sect_ps3)]} { set url $upgames(ps3url) }
if {[string match -nocase [lindex $arg 0] $upgames(sect_psp)]} { set url $upgames(pspurl) }
if {[string match -nocase [lindex $arg 0] $upgames(sect_xbox)]} { set url $upgames(xboxurl) }
if {[string match -nocase [lindex $arg 0] $upgames(sect_x360)]} { set url $upgames(x360url) }
if {[string match -nocase [lindex $arg 0] $upgames(sect_wii)]} { set url $upgames(wiiurl) }
if {[string match -nocase [lindex $arg 0] $upgames(sect_nds)]} { set url $upgames(ndsurl) }
if {$url == ""} { puthelp "PRIVMSG $chan :\002[lindex $arg 0]\002 is not a valid section. "
return }
puthelp "PRIVMSG $chan :Lastest\002 10\002 Upcoming games for \00307[string toupper [lindex $arg 0]]\00300:"
SEARCH CODE HERE
}
from help " !topgames <Number> (Number is optional, has to be between 1 and 20 , > 20 only for @)
The Output could be something like this:
[#Position][ Game ][ Plataform ]
(@me) !topgames 1
(@bot) [#1][ Halo 3 ][ Xbox 360 ]
Code: Select all
proc show_top {nick host hand chan arg} {
global upgames
if {[lindex $arg 0] == ""} { set NumberShow 10
} else { set NumberShow [lindex $arg 0] }
puthelp "PRIVMSG $chan :Showing the \002Top $NumberShow\002 Games.. "
SEARCH CODE HERE
}
proc show_help {nick host hand chan arg} {
global upgames
puthelp "PRIVMSG $chan :Commands available: "
puthelp "PRIVMSG $chan :View Upcoming Games: \002$upgames(show)\002 <\002Section\002> "
puthelp "PRIVMSG $chan :Sections Available: \002$upgames(view_sections)\002 "
puthelp "PRIVMSG $chan :View Top Games: \002$upgames(top_games)\002 <\002Number\002> (Number is optional, has to be between 1-20 , > 20 only for @) "
puthelp "PRIVMSG $chan :View Help duh: \002$upgames(help)\002 "
}
putlog "UpComingGames.tcl v$uver successfully loaded."
tnks in advance