MMOPRG Spell Tracker

Published  Feb 27, 2011
Updated  Feb 27, 2011
0  4

Description


Let me first state that I am not the maker of this script,but have full rights to use and edit as I choose. The creator retired from the MMO that I am now a moderator for.

The game,The Reincarnation, many years ago was called Arch Mage, This was a spell tracker, that when you would post on the irc that you spelled a player, it would update the website, kinda like a reverse RSS. instead of website to irc, it was intended to be IRC to website.

I am looking for help getting this configured on my website.

My website is http://ghostwarrior.org/forums & http://ghostwarrior.org

My website RSS is http://ghostwarrior.org/forums/feed.php

The script

*please note: while I am good at butchering a script to fit my own needs, I have some trouble in writing the from scratch. And once more, I did not write this, a friend who retired from the MMO gave it to me with all of his work, before leaving. Any help would be awesome(I am the sole owner of the above linked website).


Also here is an example as to what the spell looks like we would paste into irc

You start to concentrate on the spell
Summon Locust Swarm.
You finished casting the spell Summon
Locust Swarm on supahstrikah (#284).
The Goddess of Revenge grins at you.

I do not recall if this script was linked directly to the forum spell tracker, but I have the files for that as well

Script included in a txt file


on *:LOAD:{
if ( %spelltrackerchan == $null ) {
/set %spelltrackerchan $?="spelltracker channels? $crlf $+ e.g. #chan1,#chan2" }
if ( %spelltrackercolor1 == $null ) {
/set %spelltrackercolor1 $?="Color 1? press ctrl+k and choose." }
if ( %spelltrackercolor2 == $null ) {
/set %spelltrackercolor2 $?="Color 2? press ctrl+k and choose." }
if ( %spelltrackeraddr == $null ) {
/set %spelltrackeraddr $?="Enter spelltracker's website." }
if ( %spelltrackerport == $null ) {
/set %spelltrackerport $?="Enter spelltracker's website port (usually 80)." }
if ( %spelltrackerphploc == $null ) {
/set %spelltrackerphploc $?="Enter spelltracker's getinfo.php location (usually /tracker/)." }
if ( %spelltrackerpwd == $null ) {
/set %spelltrackerpwd $?="Enter spelltracker password." }
}

; triggers
on :text:!spellhelp:%spelltrackerchan: /spells_help $2-
on :text:!spellshelp:%spelltrackerchan: /spells_help $2-
on :text:!spells :%spelltrackerchan: /mage_list $2-
on :text:!spells:%spelltrackerchan: /mage_list
on
:text:!spelladd:%spelltrackerchan: /spell_add $2-
on
:text:!spellremove*:%spelltrackerchan: /spell_remove $2-

on :text:!noteadd:%spelltrackerchan: /note_add $2-

on :text:!mageadd:%spelltrackerchan: /mage_add $2-
on :text:!magedit:%spelltrackerchan: /mage_edit $2-
on :text:!mageedit:%spelltrackerchan: /mage_edit $2-
on :text:!mageremove:%spelltrackerchan: /mage_remove $2-
on :text:!magedel:%spelltrackerchan: /mage_remove $2-
on :text:!mageinfo:%spelltrackerchan: /mage_info $2-

; maintenance functions
on *:text:!releasetracker:%spelltrackerchan: /release_tracker

alias /release_tracker {
set %spelltracker_isbusy 0
/remove spelltrackerresult.html
}

; triggers for the result posts
on :text:You finished casting the spell :%spelltrackerchan: {
if ($spelltracker_chkbusy()) goto end
; mark spelltracker not busy for spell_add alias call
set %spelltracker_isbusy 0
var %x 0
var %i = $0
%i = %i - 1
var %caster = $nick
var %spell = $6
var %target = $gettok($1-, %i, 32)
var %number = $gettok($1-, $0, 32)
%left = $left(%number,1)
%x = $pos(%number,#,1)
%spelltrackerhtml = ""
if (%left != $chr(40)) {
/spell_add %number %spell %caster
}
else {
/spell_add %target %spell %caster
}
:end
}

on :text:Your spell cast upon was dispelled.:%spelltrackerchan: {
if ($spelltracker_chkbusy()) goto end
; mark spelltracker not busy for spell_remove alias call
set %spelltracker_isbusy 0
var %x 0
var %i = $0
%i = %i - 3
var %caster = $nick
var %spell = $3
var %target = $gettok($1-, %i, 32)
/spell_remove %target %spell dispell
:end
}

; WeOnceWereWarriors (#2549) was purified from your spell Confuse.
on :text: (#) was purified from your spell :%spelltrackerchan: {
if ($spelltracker_chkbusy()) goto end
; mark spelltracker not busy for spell_remove alias call
set %spelltracker_isbusy 0
var %caster = $nick
var %spell = $remove($8-,$chr(46))
var %target = $1
/spell_remove %target %spell purify
:end
}

; earthquake
; Seismic vibrations caused magename number's nodes to leak x,xxx,xxx m.p.
on :text:Seismic vibrations caused nodes to leak m.p.:%spelltrackerchan: {
if ($spelltracker_chkbusy()) goto end
; mark spelltracker not busy for spell_remove alias call
set %spelltracker_isbusy 0
var %caster = $nick
var %spell = eq

var %i = $0
%i = %i - 6
%n = $0 - 1

var %target = $gettok($1-, %i, 32)
var %manaloss = $gettok($1-, %n, 32)

%manaloss = $replace(%manaloss, $chr(44), $chr(0))

/msg $chan Earthquake cast on %target making him lose %manaloss mana

:end
}

; aliases
alias /spells_help {
if ($spelltracker_chkbusy()) goto end
if ($1) {
if (($1 == mage) || ($1 == mages)) goto mage
if (($1 == note) || ($1 == notes)) goto note
if (($1 == item) || ($1 == items)) goto item
if (($1 == spell) || ($1 == spells)) goto spell
}
:spell
/msg $chan %spelltrackercolor1 $+ !spells <target> - Displays all enemies or one enemy if target.
/msg $chan %spelltrackercolor1 $+ !spelladd <
caster> - Add spell on target
/msg $chan %spelltrackercolor1 $+ !spellremove <method> - Remove spell, method can be dispell or purify
if ($1) goto endnote
:note
/msg $chan %spelltrackercolor1 $+ !noteadd - Add a short note on target
if ($1) goto end
:mage
/msg $chan %spelltrackercolor1 $+ !mageadd <
number> <color> <guild> <priority> <type> - Add mage, type can be enemy, member or ally
/msg $chan %spelltrackercolor1 $+ !magedit <number> <color> <guild> <priority> - Edit mage info
/msg $chan %spelltrackercolor1 $+ !mageremove <reason> - Remove mage, reason can be unlist or death(default)
/msg $chan %spelltrackercolor1 $+ !mageinfo <
type> - Display mage info, type can be all, critical, stack or any 1 bit (gold, nodes, etc)
if ($1) goto endnote
:item
/msg $chan %spelltrackercolor1 $+ !itemadd - Record item usage on enemy mage
if ($1) goto noteitem
:endnote
/msg $chan %spelltrackercolor1 $+ : the parameters with in front are optional
:noteitem
/msg $chan %spelltrackercolor1 $+ NOTE: you can also post the item/spell result on this channel and it will be added automatically
:end
set %spelltracker_isbusy 0
}

alias /mage_list {
if ($spelltracker_chkbusy()) goto end
set %spelltrackerprintchan $chan
%spelltrackerhtml = do=list
if ($1 != $null) %spelltrackerhtml = do=mageshow&target= $+ $htmlstring($1)
.sockopen SpellsLookup %spelltrackeraddr %spelltrackerport
:end
}

alias /spell_add {
if ($spelltracker_chkbusy()) goto end
if ($2 == $null) goto error2
if ($4 != $null) goto error1
set %spelltrackerprintchan $chan
var %caster = $nick
if ($3 != $null) %caster = $3
%spelltrackerhtml = do=spelladd&target= $+ $htmlstring($1) $+ &spell= $+ $spell_parse($2) $+ &caster= $+ %caster

.sockopen SpellsLookup %spelltrackeraddr %spelltrackerport
goto end

:error1
set %spelltracker_isbusy 0
/msg $chan %spelltrackercolor1 $+ Too many parameters, each parameter should contain only one word and no spaces
goto end

:error2
set %spelltracker_isbusy 0
/msg $chan %spelltrackercolor1 $+ Missing parameters!

:end
}

alias /spell_remove {
if ($spelltracker_chkbusy()) goto end
if ($2 == $null) goto error2
if ($4 != $null) goto error1
set %spelltrackerprintchan $chan
var %status 1
if ($3 == dispell) %status = 2
if ($3 == purify) %status = 3
%spelltrackerhtml = do=spellremove&target= $+ $1 $+ &spell= $+ $spell_parse($2) $+ &status= $+ %status
.sockopen SpellsLookup %spelltrackeraddr %spelltrackerport
goto end

:error1
set %spelltracker_isbusy 0
/msg $chan %spelltrackercolor1 $+ Too many parameters, each parameter should contain only one word and no spaces
goto end

:error2
set %spelltracker_isbusy 0
/msg $chan %spelltrackercolor1 $+ Missing parameters!

:end
}

alias /note_add {
if ($spelltracker_chkbusy()) goto end
if ($2 == $null) goto error1
set %spelltrackerprintchan $chan
%spelltrackerhtml = do=spelladd&target= $+ $htmlstring($1) $+ &spell=note&note= $+ $htmlstring($2-)
.sockopen SpellsLookup %spelltrackeraddr %spelltrackerport
goto end

:error1
set %spelltracker_isbusy 0
/msg $chan %spelltrackercolor1 $+ Missing parameters!

:end
}

alias /mage_add {
; parameters: <number> <color> <guild> <priority> <*type>

if ($spelltracker_chkbusy()) goto end
if ($1 == $null) goto error1
if ($7 != $null) goto error2
set %spelltrackerprintchan $chan
%type = 0
if ($6 != $null) %type = $6
%priority = 0
if ($5 != $null) %priority = $5
if ($2 == unlist) %status = 2
%spelltrackerhtml = do=mageadd&target= $+ $htmlstring($1) $+ &number= $+ $2 $+ &color= $+ $3 $+ &guild= $+ $4 $+ &priority= $+ %priority $+ &type= $+ %type

.sockopen SpellsLookup %spelltrackeraddr %spelltrackerport
goto end

:error1
set %spelltracker_isbusy 0
/msg $chan %spelltrackercolor1 $+ Missing parameters!

:end
}

alias /mage_edit {
; parameters: <number> <color> <guild> <priority>

if ($spelltracker_chkbusy()) goto end
if ($1 == $null) goto error1
if ($6 != $null) goto error2
set %spelltrackerprintchan $chan
%priority = 0
if ($5 != $null) %priority = $5
if ($2 == unlist) %status = 2
%spelltrackerhtml = do=mageedit&target= $+ $htmlstring($1) $+ &number= $+ $2 $+ &color= $+ $3 $+ &guild= $+ $4 $+ &priority= $+ %priority
.sockopen SpellsLookup %spelltrackeraddr %spelltrackerport
goto end

:error1
set %spelltracker_isbusy 0
/msg $chan %spelltrackercolor1 $+ Missing parameters!

:error2
set %spelltracker_isbusy 0
/msg $chan %spelltrackercolor1 $+ Too many parameters, each parameter should contain only one word and no spaces

:end
}

alias /mage_remove {
if ($spelltracker_chkbusy()) goto end
if ($1 == $null) goto error1
if ($3 != $null) goto error2
set %spelltrackerprintchan $chan
%status = 1
if ($2 == unlist) %status = 2
%spelltrackerhtml = do=mageremove&target= $+ $htmlstring($1) $+ &status= $+ %status
.sockopen SpellsLookup %spelltrackeraddr %spelltrackerport
goto end

:error1
set %spelltracker_isbusy 0
/msg $chan %spelltrackercolor1 $+ Missing parameters!
goto end

:error2
set %spelltracker_isbusy 0
/msg $chan %spelltrackercolor1 $+ Too many parameters, each parameter should contain only one word and no spaces

:end
}

alias /mage_info {
if ($spelltracker_chkbusy()) goto end
if ($2 == $null) goto error1
if ($3 != $null) goto error2

set %spelltrackerprintchan $chan
%getinfo = $2
%spelltrackerhtml = do=mageinfo&target= $+ $htmlstring($1) $+ &info= $+ %getinfo
.sockopen SpellsLookup %spelltrackeraddr %spelltrackerport
goto end

:error1
set %spelltracker_isbusy 0
/msg $chan %spelltrackercolor1 $+ Missing parameters!
goto end

:error2
set %spelltracker_isbusy 0
/msg $chan %spelltrackercolor1 $+ Too many parameters, each parameter should contain only one word and no spaces

:end
}

; socket handling
on *:SOCKOPEN:SpellsLookup: {
.sockwrite -tn SpellsLookup GET /tracker/irctracker.php? $+ pwd= $+ %spelltrackerpwd $+ & $+ %spelltrackerhtml HTTP/1.1
.sockwrite -n SpellsLookup Host: %spelltrackeraddr $+ $crlf $+ $crlf
; debug some:
;/msg %spelltrackerprintchan html: %spelltrackeraddr $+ /tracker/irctracker.php? $+ pwd= $+ %spelltrackerpwd $+ & $+ %spelltrackerhtml
}

on *:SOCKREAD:SpellsLookup: {
if ($sockerr > 0) return
:nextread
sockread -fn &var
if ($sockbr == 0) return
bwrite spelltrackerresult.html -1 -1 &var
goto nextread
}

on *:SOCKCLOSE:SpellsLookup: {
/bread spelltrackerresult.html 1 $file(spelltrackerresult.html).size &spelltrackerpage
/var %i 0
/var %j 0
/var %spelltrackerline
/var %currentspelltracker
while (1) {
%i = $bfind(&spelltrackerpage, $calc(%i + 1), ##).text
if (!%i) {
/break
}
%currentinfo = $spelltrackerparse($bvar(&spelltrackerpage, %i, 600).text)
%spelltrackerline = $gettok(%currentinfo,1,10)
if (%spelltrackerline && $len(%spelltrackerline) > 10) {
/msg %spelltrackerprintchan %spelltrackerline
}
}
; release spell tracker for use
/remove spelltrackerresult.html
set %spelltracker_isbusy 0
}

; formatting stuff aliases
alias spell_parse {
var %spell = $lower($1)
if ($left(%spell, 3) == cal) return cl
if ($left(%spell, 3) == met) return ms
if ($left(%spell, 3) == dea) return dnd
if ($left(%spell, 3) == tem) return tsf
if ($left(%spell, 3) == con) return conf
if ($left(%spell, 3) == laz) return lazy
if ($left(%spell, 3) == ser) return seren
if ($left(%spell, 3) == sum) return sls
return %spell
}

alias spelltrackerparse {
var %x = $replace($1, ##, $null)
%x = $replace(%x, , %spelltrackercolor1)
%x = $replace(%x, , %spelltrackercolor2)
%x = $replace(%x, , 4)
%x = $replace(%x, , 1 $+ $chr(44) $+ 0)
%x = $replace(%x, , 0 $+ $chr(44) $+ 1)
%x = $replace(%x, , 3)
%x = $replace(%x, , 12)
%x = $replace(%x, , 14)
%x = $replace(%x, , )
%x = $replace(%x, , )
%x = $replace(%x, , )
return %x
}

alias htmlstring {
var %x = $replace($1,$chr(32),$chr(37) $+ 20)
var %x = $replace(%x,$chr(35),$chr(37) $+ 23)
var %x = $replace(%x,$chr(39),$chr(37) $+ 27)
return %x
}

; other helpfull aliases
alias spelltracker_chkbusy {
if (%spelltracker_isbusy == 1) {
/msg $chan %spelltrackercolor1 $+ Tracker is busy, try again in a bit!
return 1
}
set %spelltracker_isbusy 1
}

Download

Filename
Size
Date
Downloads
2.83 KB
Feb 27, 2011
52

Comments

Sign in to comment.
sunslayer   -  Feb 27, 2011

just leave Hawkee a comment

 Respond  
ghostwarrior   -  Feb 27, 2011

@joelp54
sorry, It was my 1st post , I may have messed up some, such as the name . Was always a butcher of scripts, not a creator

@sunslayer
ok , should I delete this? or can a forum mod/admin move the thread?

and thanks for the feed back. My apologies for noobing around in the wrong section

 Respond  
sunslayer   -  Feb 27, 2011

this should have been posted in the forums

 Respond  
joelp54   -  Feb 27, 2011

Shouldn't this be a snippet sir?

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.