mIRC Home    About    Download    Register    News    Help

Print Thread
scripting error #163413 29/10/06 05:16 PM
Joined: Oct 2006
Posts: 60
M
moshkin Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Oct 2006
Posts: 60
on *:text:!event *:#:{
/msg $chan Todays event is: %event
}
on *:text:!setevent*:#:{
if ($nick isop $chan) {
set %event $2-
/msg $nick The event has been set to: %event }
}
on *:TEXT:!credits*:#: {
/notice $nick We owe credits to the following people: Duelist91, for the "Event" commands.
}



did i do something wrong?

Re: scripting error #163414 29/10/06 05:41 PM
Joined: Dec 2002
Posts: 43
C
Cypris Offline
Ameglian cow
Offline
Ameglian cow
C
Joined: Dec 2002
Posts: 43
Quote:

on *:text:!event *:#:{
/msg $chan Todays event is: %event
}


Well, besides inconsistant scripting methods, and the fact that the trigger seems to require no further text beyond the trigger, unlike !setevent which requires a string following the trigger to work properly, i'd have to point out that in order to perform the !event trigger you'd need to provide a space after the trigger, because you included a space inbetween "!event" and *, like so...

Yours: on *:text:!event *:#:{
Moded: on *:text:!event*:#:{
Better: on *:text:!event:#:{

and on a scripting method note, keep your scripts uniform, dont type on *:TEXT in one line and then on *:text on the next, also it makes it easiert to read if end brackets either end on their own line, or following at the end of the last line, not both...

on *:text:!setevent*:#:{
if ($nick isop $chan) {
set %event $2-
/msg $nick The event has been set to: %event } <--at the end
} <---by itself

also to prevent your own confusion, do not use wildcards where they are not needed. its always the simple $#!+ that makes you debug your code for hours to find out you forgot a character.

Hope this helps


-Cypris
Re: scripting error #163415 29/10/06 06:08 PM
Joined: Oct 2006
Posts: 60
M
moshkin Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Oct 2006
Posts: 60
ive done all that but it still doesnt work

Re: scripting error #163416 29/10/06 06:13 PM
Joined: Oct 2006
Posts: 60
M
moshkin Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Oct 2006
Posts: 60
On *:TEXT:!commands:#: .notice $nick [Welcome $+($nick,!!!) My Commands Are <!tb (nick) (time in minutes) (reason)> <!milk (user who u wish to recieve a glass of milk from)>

on *:TEXT:!tb*:#:{
if (($nick isop $chan) || ($nick ishop $chan)) {
ban -ku $+ $calc($3 * 60) $chan $2 (Temp-Ban for $3 Minute(s) KickedBy: $nick Reason: $4-)}}

on *:text:!drink:#:{
if ($2 == buy) {
msg $chan Here is a refreshing glass of $4 $+ $chr(44) $3 $+ . On $nick $+ s tab. }

on *:TEXT:!pint:#: {
msg $chan Here $nick, have a pint on me! }

on *:text:!event:#: {
/msg $chan Todays event is: %event }

on *:text:!setevent:#: {
if ( $nick isop $chan ) || ( $nick ishop $chan ) {
set %event $2-
/msg $nick The event has been set to: %event }

on *:TEXT:!credits:#: {
/notice $nick We owe credits to the following people: Duelist91 - for the "Event" commands, Moshkin_Khan - For the original Bot, Junglebiscui - For the inspiration. }


on *:text:!bartender:#:{
if ($eval($+(%,floodstop.,$nick),2) > 1) { return }
else {
if ($eval($+(%,floodstop.,$nick),2) == $null) {
set -u5 %floodstop. $+ $nick 1}
else {
set -u5 %floodstop. $+ $nick 2}
:bartender
if ($2 == buy) {
describe $chan serves a refreshing $4- to $3 $+ . On $nick $+ s tab.}
else {describe $chan serves $nick a refreshing $2- $+ . }

Re: scripting error #163417 29/10/06 06:17 PM
Joined: Dec 2002
Posts: 43
C
Cypris Offline
Ameglian cow
Offline
Ameglian cow
C
Joined: Dec 2002
Posts: 43
ok i think i may know what your doing...

You put your script into the remotes area and you save and close the script window, you then try to use !setevent and !event and nothing right? well thats because remotes are to be used exactly as the name suggests, remotely. the only time you activate a script in mirc is by alias or popup normally. on TEXT does not pay attention to what you type. it only cares about what it recieves from others. I believe what you want maybe on INPUT... similar syntax to on TEXT.


-Cypris
Re: scripting error #163418 29/10/06 06:22 PM
Joined: Oct 2006
Posts: 60
M
moshkin Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Oct 2006
Posts: 60
the above is my whole script, literally all of it, im just new to it all. i have no idea waht u mean :s confused

Re: scripting error #163419 29/10/06 06:55 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Usage of the on text event will not respond when you type the command.
Example 1:
Joe types !credit
You respond with a notice to Joe saying We owe credits to the following people: Duelist91 - for the "Event" commands, Moshkin_Khan - For the original Bot, Junglebiscui - For the inspiration.

Example 2:
You type !credit
nothing happens

You have two options: 1) Run a second copy of mIRC that acts as a bot, and put the script on the bot, then it'll work when you issue the commands from your client (not the bot).
2) Re-write the script so that it has on input events as well as the on text events.