Hey, I thought there would be a way to choose when my variables were pulled from a file, but I can't find it if there is one.
I was trying to do
.timer 1 120 set -l %var $readini(file.ini, example, example)
but the var kept coming back as null, because the event was writing to file.ini during those 2 minutes and (I can only assume) the var was being pulled before it existed.

For context, I'm trying to make a giveaway system, where !giveaway opens up a window for 2 minutes, during which anyone can do !enter and their name is saved to a .ini. After the two minutes, it picks a random person from the list and chooses them to win. Currently, everything seems to be working except the variables, because they can't find anything in the list (even though I have it open, and all the people are there).
Not sure if this helps, but I'll just put the full code below.

alias findWinner {
set -l %entnum $readini(Giveaway.ini, Status, NumEntered)
set -l %winnum $rand(1,%entnum)
set -l %winner $readini(Giveaway.ini, List, %winnum)
return %winner
}

on 2:TEXT:!giveaway*:#atkion:{
msg $chan $nick has just started a giveaway! For the next two minutes, do !enter to secure your chance!
writeini -n Giveaway.ini Status status true
writeini -n Giveaway.ini Status NumEntered 0
timer 1 120 writeini -n Giveaway.ini Status status false
timer 1 120 msg $chan The Giveaway is now closed! Further entries will not be counted
timer 1 120 describe $chan is rolling the dice...
timer 1 120 set -l %winner $findWinner
timer 1 120 msg $chan The winner is %winner ! Congratulations
timer 1 121 remini -n Giveaway.ini List
}

on *:TEXT:!enter*:#atkion:{
var %giveaway $readini(Giveaway.ini, Status, status)
if (%giveaway == true) {
var %entnum $readini(Giveaway.ini, Status, NumEntered)
inc %entnum
writeini -n Giveaway.ini List %entnum $nick
writeini -n Giveaway.ini Status NumEntered %entnum
}
else {
msg $chan $nick , a giveaway is not currently taking place.
}
}

Does anyone know if there's a way to force a variable to update?
Or to choose when a variable is pulled in the first place?