on *:text:!ticket:#:{
if ($hget($+(tickets.,#),$nick)) { msg # $nick You already have a ticket! | return }
var %topic = $+(#,.,$nick)
; Check if enough points
if ($readini(Points.ini,%topic,Points) >= 20) {
; Deduct the points
var %a = $v1 - 20
writeini Points.ini %topic Points %a
; Add the user to tickets.#channel hash table, creating the table if it doesn't exist
hinc -m $+(tickets.,#) $nick
msg # $nick You bought a ticket, you now have %a points.
}
else msg # $nick Sorry, you only have $v1 points.
}