I'm in the process of making a 'favoritizer' script. Basically I want it to give me choices between 2 items (of a list I entered) and make a list based on those choices. Right now I got something fairly simple, which just replaces items if a lower ranked item is valued higher than a higher ranked item. Anyway, this is it:
;;;;; Variables ;;;;
Alias -l Nickname { return AMBot }
Alias -l ServerAndPort { return irc.utonet.org:6667 }
Alias -l Channel { return #AM }
On *:start:.nick $nickname | .server $serverandport -j $channel
On *:text:*:?:{
if ($1 == !File) && ($2) {
if (!$isfile($2)) { msg $nick File ' $+ $2 ' does not exist | halt }
Set %file. [ $+ [ $nick ] ] $2
msg $nick Loaded ' $+ $2 '. To start, please type !start
}
if ($1 == !start) {
kk $nick
}
if ($1 == !1) {
if (!%file. [ $+ [ $nick ] ]) { msg $nick You did not select a file | halt }
var %file = %file. [ $+ [ $nick ] ] , %1 = %tmp.1. [ $+ [ $nick ] ] , %2 = %tmp.2. [ $+ [ $nick ] ]
if (%2 < %1) { var %z1 = $read(%file,%1) , %z2 = $read(%file,%2) | write -l [ $+ [ %2 ] ] %file %z1 | write -l [ $+ [ %1 ] ] %file %z2 }
kk $nick
}
if ($1 == !2) {
if (!%file. [ $+ [ $nick ] ]) { msg $nick You did not select a file | halt }
var %file = %file. [ $+ [ $nick ] ] , %1 = %tmp.1. [ $+ [ $nick ] ] , %2 = %tmp.2. [ $+ [ $nick ] ]
if (%2 > %1) { var %z1 = $read(%file,%1) , %z2 = $read(%file,%2) | write -l [ $+ [ %2 ] ] %file %z1 | write -l [ $+ [ %1 ] ] %file %z2 }
kk $nick
}
}
alias kk {
var %z = %file. [ $+ [ $1 ] ]
:s
var %i = $r(1,$lines(%z))
var %ii = $r(1,$lines(%z))
if (%i == %ii) { goto s }
set %tmp.1. [ $+ [ $1 ] ] %i
set %tmp.2. [ $+ [ $1 ] ] %ii
msg $1 12!1 : $read(%z,%i) 14( $+ %i $+ ) • 6!2 : $read(%z,%ii) 14( $+ %ii $+ )
}
Now, that does work flawless, but it's very time consuming. Say a list has 100 items, the chance of it bringing up say item 13 and 14 will be very small. So I could choose for hours and hours and still not get a perfect ranking.
I'm trying to think of ideas to fix this, possibly have the script remember relations, so if I rank 14 over 7, but I've previously ranked 9 over 14, it'll place item 14 at 10 rather than 7. I hope that makes any sense.
I've come up with squat, my scripting is not advanced enough to do things like that, so I turn here for help. Any kind of advice works, even a whole different script would work, perhaps even an existing one. Hell, if you have an html, php or javascript.. I'd happily take it.
Thank in advance.