Non posso dirti cosa c'è che non va senza vederne il codice

Dragone2 ha scritto: 17/12/2024, 10:33 Ciao, lo script che hai fornito non ha nessun codice che gestisca gli input successivi, conseguentemente o pubblichi tutto lo script e cerco di capire cosa non va, oppure così è incompleto.
Non posso dirti cosa c'è che non va senza vederne il codice![]()
Codice: Seleziona tutto
on *:TEXT:*:#channel:{
if ($1 == !game && $nick($chan,$nick,~@)) {
set %topnum $iif($2,$2,100) | set %number $rand(1,%topnum)
msg $chan Indovinate il numero compreso fra 1 e %topnum | hfree -w number *
}
if ($1 == !number) {
if (!%number) { msg $chan Come up with a new number: !game [number] | return }
if (!$2) { notice $nick Correct syntax: !number <number> | return }
if ($2 !isnum $+(1-,%topnum)) { notice $nick Possible range: !number $v2 | return }
if ($hget(number,$nick)) { notice $nick The next attempt is possible in $v1 secs. | return }
if ($2 > %number) { msg $chan The number $2 is greater than the hidden number. }
if ($2 < %number) { msg $chan The number $2 is less than the hidden number. }
if ($2 == %number) {
msg $chan $nick $read(you.txt,nt) you win! The number was %number
if ($read(win.txt,ntw,$nick *)) {
var %rn $readn, %score $gettok($read(win.txt,nt,%rn),2,32)
write $+(-l,%rn) win.txt $nick $calc(%score + 1)
}
else { write -i win.txt $nick 1 } | unset %number | hfree -w number * | return
}
hadd -mz number $nick 300
}
if ($1 == !score) {
if ($2) {
if ($read(win.txt,ntw,$2 *)) { msg $chan Score for $+(,$2,:) $read(win.txt,nts,$2) points }
else msg $chan There is no record in the database for a player with the nickname: $2
}
else { notice $nick Nick: --- Score: | play -nx $nick win.txt 1000 }
}
}
Codice: Seleziona tutto
on *:TEXT:*:#Dragone2:{
if ($1 == !game) {
if (~ isin $nick(#,$nick).pnick) {
set %topnum $iif($2,$2,100) | set %number $rand(1,%topnum)
msg $chan Indovinate il numero compreso fra 1 e %topnum | hfree -w number *
}
else {
msg # Non hai i privilegi per eseguire il comando. Rivolgiti all'amministratore del canale. Grazie
}
}
if ($1 == !number) {
if (!%number) { msg $chan Come up with a new number: !game [number] | return }
if (!$2) { notice $nick Correct syntax: !number <number> | return }
if ($2 !isnum $+(1-,%topnum)) { notice $nick Possible range: !number $v2 | return }
if ($hget(number,$nick)) { notice $nick The next attempt is possible in $v1 secs. | return }
if ($2 > %number) { msg $chan The number $2 is greater than the hidden number. }
if ($2 < %number) { msg $chan The number $2 is less than the hidden number. }
if ($2 == %number) {
msg $chan $nick $read(you.txt,nt) you win! The number was %number
if ($read(win.txt,ntw,$nick *)) {
var %rn $readn, %score $gettok($read(win.txt,nt,%rn),2,32)
write $+(-l,%rn) win.txt $nick $calc(%score + 1)
}
else { write -i win.txt $nick 1 } | unset %number | hfree -w number * | return
}
hadd -mz number $nick 300
}
if ($1 == !score) {
if ($2) {
if ($read(win.txt,ntw,$2 *)) { msg $chan Score for $+(,$2,:) $read(win.txt,nts,$2) points }
else msg $chan There is no record in the database for a player with the nickname: $2
}
else { notice $nick Nick: --- Score: | play -nx $nick win.txt 1000 }
}
}
Occhio perché c'è un timeout di 5 minuti tra un tentativo e l'altro:-[14:40:51]- * Dragone2 sets mode: +q ChanServ
-[14:40:55]- <~ChanServ> !game
-[14:40:55]- <~Dragone2> Indovinate il numero compreso fra 1 e 100
-[14:41:14]- <~ChanServ> !number 1
-[14:41:14]- <~Dragone2> The number 1 is less than the hidden number.
L'output esce come notice e lo vedi nello status.-[14:41:52]- -> -ChanServ- The next attempt is possible in 263 secs.
-[14:41:56]- -> -ChanServ- Correct syntax: !number <number>
Ovviamente funziona alla grande, non avevo dubbi sulle tue capacità ^^ Gira su un mIRC 7.65 perfettamenteCiao,
unendo le modifiche a me sembra che funzioni correttamente:
Sì sì, quello lo sapevo e si modifica daOcchio perché c'è un timeout di 5 minuti tra un tentativo e l'altro:
Codice: Seleziona tutto
hadd -mz number $nick 300
Anche gli output li ho modificati inL'output esce come notice e lo vedi nello status.
Codice: Seleziona tutto
msg $chan $nick
Codice: Seleziona tutto
else { msg $chan $nick Nick --- Risposte | play -nx $nick win.txt 1000 }
Codice: Seleziona tutto
else { msg $chan Nick: --- Score: | play -x $chan win.txt 1000 }
Ciao a te e parto con un primo GRAZIE DELLA PAZIENZA.Dragone2 ha scritto: 17/12/2024, 17:36 Ciao,
Per lo !score, basta che togli il "-n" da play:Per la noticeflood protection, probabilmente hai qualche script di protezione dal flood notice, aggiungi un'eccezione per il nickname del bot o disattivalo, tanto ormai chi è che flooda in notice su IRC? AhahahCodice: Seleziona tutto
else { msg $chan Nick: --- Score: | play -x $chan win.txt 1000 }
Codice: Seleziona tutto
else { msg $chan $nick Nick --- Risposte | play $chan win.txt 2000 }
Codice: Seleziona tutto
if (~ isin $nick(#,$nick).pnick) {
Codice: Seleziona tutto
if ($nick == %proprietario. [ $+ [ $network ] ]) {