ok. The point is, the final event
on *:sockclose:market: {
msg #channel 04Market: %market
unset %market
}does not provide a $chan, it is not related to the initial on text-event. You have to store the place where "!market" had been typed manually.
e.g.
change:
on *:text:!market:#channel: {
sockopen market www.lunarwars.net 80
}to:
on *:text:!market:#channel: {
set -e %marketprices.chan $chan
sockopen market www.lunarwars.net 80
}and change:
on *:sockclose:market: {
msg #channel 04Market: %market
unset %market
}to:
on *:sockclose:market: {
if ($me ison %marketprices.chan) { msg $v2 04Market: %market }
unset %market | unset %marketprices.chan
}I am well aware that "/set" is not the neatest way to store temporary data like this, but you have to modify the given code least
