mIRC Home    About    Download    Register    News    Help

Print Thread
i need help with a script. #58268 29/10/03 10:07 PM
Joined: Oct 2003
Posts: 9
G
grinch157 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
G
Joined: Oct 2003
Posts: 9
i wan't to make a script that basicly works with the on text trigger idea like so:

On *:text:!rules:#channel: { .play -n $nick #channel-rules.txt }

thats easy enough but i would like to elaberate on it.
i would like to have is so one script will do jobs.
like a sep on text trigger for each job for example 1 for rules, 1 for serving requirements, and one for new file listings.
and going back to shadowdemons query with the combo box and editing i would like to be able to create a dialog using a tab format to edit each one.

how do i do this???

Re: i need help with a script. #58269 30/10/03 12:19 AM
Joined: Dec 2002
Posts: 417
O
Othello Offline
Fjord artisan
Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
you don't need to put a script like that in dialog format.
Its a simple script that uses triggers to trigger events
My suggestion would be to setup different triggers in a
chat window. Which would give the end user the option
of getting more infor on a rule. Now you have the options
of using ON ACTION, ON TEXT, ON OPEN. I have made
this script for TEXT on a Private Chat Window so when the
nick Types !RULES in the channel the script will msg them.
while the window is open they can send triggers in a
Private Chat Window for more information. I would suggest
Highlight the Triggres so they can see what the tiggers are.


On *:text:!rules:#channel: { .play -n $nick #channel-rules.txt }

ON *:TEXT:?: {
if (WORD1 isin $strip($1-,burc)) {
msg $nick <MESSAGE 1>
.timer 1 .1 closemsg $nick
}
elseif (WORD2 isin $strip($1-,burc)) {
msg $nick <MESSAGE 2>
.timer 1 .1 closemsg $nick
}
elseif (WORD3 isin $strip($1-,burc)) {
msg $nick <MESSAGE 3>
.timer 1 .1 closemsg $nick
}
}



Now if you wish to make this a self contained script you could
use triggers to read a sub sections within a script like this. Using
the triggers to read a sub-section on a script. Now this can be done to eliminate a 2nd text file to read from



On *:text:!rules:#channel: { .play -tTRIG1 $nick $script 300 | halt }

On *:TEXT:*:?: {
if !RULES == $1 { play -tTRIG1 $nick $script 300 | halt }
elseif !RULE2 == $1 { play -tTRIG2 $nick $script 300 | halt }
elseif !RULES3 == $1 { play -tTRIG3 $nick $script 300 | halt }
elseif !RULES4 == $1 { play -tTRIG4 $nick $script 300 | halt }
}


[TRIG1]
RULES 1
RULES 2
RULES 3

[TRIG2]
EXPLAIN RULE 1

[TRIG3]
EXPLAIN RULE 2

[TRIG4]
EXPLAIN RULE 3




Intelligence: It's better to ask a stupid question, then to prove it by not asking....
Re: i need help with a script. #58270 30/10/03 01:41 AM
Joined: Oct 2003
Posts: 9
G
grinch157 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
G
Joined: Oct 2003
Posts: 9
i like the idea of using the subsection listings better then the first suggestion. it's more down the alley i was thinking of. but the reason i wanted to bring the dialog into play was to make it as fast and easy as possible for myself and potentialy others.but its definatly livable.

if anyone has more input it would be appreciated smile
thanks inadvance!

Re: i need help with a script. #58271 30/10/03 03:42 PM
Joined: Oct 2003
Posts: 9
G
grinch157 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
G
Joined: Oct 2003
Posts: 9
on second look what you were saying about the on on text word search idea is appealing as a sort of make-shift auto responder... i like it and i will use. However i'm still at a loss with the whole dialog creating thing.

thanks!

Re: i need help with a script. #58272 30/10/03 09:43 PM
Joined: Dec 2002
Posts: 417
O
Othello Offline
Fjord artisan
Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
To make a dialog you can search the Scripts and Popup forum for examples. there is a small section in the Mirc help file. There is Dialog Studio whci can be downloaded from www.mircscripts.org and search for a program called Dialog Studio. Dialog Studio can help you design the lay out of and dialog windows you wish to create. As for the scripting of Dialog Windows That depends on what you wish the script to do.




Intelligence: It's better to ask a stupid question, then to prove it by not asking....
Re: i need help with a script. #58273 31/10/03 06:32 AM
Joined: Oct 2003
Posts: 9
G
grinch157 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
G
Joined: Oct 2003
Posts: 9
on *:TEXT:mtgrules*:$( $+ %rules.chans $+ ): {
var %trtimer 1
var %trtime 500
var %trtime2 2
while ( $read( $scriptdirmtgrules.list.txt,%trtimer ) != $null ) { .timer -m 1 %trtime /.notice $nick %trtimer $+ : $+ $read($scriptdirmtgrules.list.txt,%trtimer)
var %trtime $calc(%trtime * %trtime2)
inc %trtimer
}
}
On *:Dialog:mtgal:Sclick:5,6:{
If ( $did == 5 ){ /did -a mtgal 1 $did(1,0)
If ( $did == 6 ){ /did -d mtgal 1 $did(1).sel
}
on *:Dialog:mtgal:Sclick:7,8:{
If ( $did == 7 ){ /did -a mtgal 2 $did(2,0) | /write -c $scriptdirmtgRules.chans.txt $didtok(mtgal,2,44)
If ( $did == 8 ){ /did -d Rules 2 $did(2).sel | /write -c $scriptdirmtgRules.chans.txt $didtok(mtgal,2,44)
}
on *:Dialog:mtgals:close:0:{
/write -c $scriptdirmtgrules.list.txt
var %temp 1
while ( $did(1,%temp) != $null ) { /write $scriptdirmtgrules.list.txt $did(1,%temp)
inc %temp
}
/set %mtgRules.chans $did(2,1) $+ , $+ $did(2,2) $+ , $+ $did(2,3) $+ , $+ $did(2,4)
/write -l1 $scriptdirmtgrules.chans.txt $did(2,1) $+ , $+ $did(2,2) $+ , $+ $did(2,3) $+ , $+ $did(2,4)
}

on *:Dialog:mtgal:Init:0:{
var %t.r.l 1
while ( $read( $scriptdirmtgrules.list.txt,%t.r.l ) != $null ) { /did -a Rules 1 $read( $scriptdirmtgrules.list.txt,%t.r.l )
inc %t.r.l
}
didtok mtgal 2 44 $read -l1 $scriptdirmtgrules.chans.txt
}
dialog mtgal {
title "MTG Auto-Lister Script"
size -1 -1 311 199
option dbu
tab "Channel Rules", 1, 2 12 292 160
combo 1, 9 62 191 85, tab 1 size, edit
combo 2, 222 44 60 50, tab 1 size, edit
text "Channels", 3, 238 31 25 8, tab 1
text "Channel Rules", 4, 79 49 37 8, tab 1
button "ADD RULE", 5, 59 150 37 12, tab 1
button "DELETE RULE", 6, 116 150 41 13, tab 1
button "Add", 7, 226 96 23 12, tab 1
button "Delete", 8, 254 96 26 12, tab 1
tab "Server Requirements", 2
combo 9, 14 60 188 89, tab 2 size
combo 10, 223 43 60 50, tab 2 size
button "ADD RULE", 11, 47 153 37 12, tab 2
button "DELETE RULE", 12, 106 153 40 12, tab 2
button "Add", 13, 227 98 26 12, tab 2
button "Delete", 14, 258 98 22 12, tab 2
text "Channels", 15, 239 31 25 8, tab 2
text "Serving Requirements", 16, 78 48 57 8, tab 2
tab "New Movies", 3
combo 17, 12 66 167 78, tab 3 size
combo 18, 222 43 60 50, tab 3 size
button "ADD MOVIE", 19, 31 148 37 12, tab 3
button "DELETE MOVIE", 20, 97 148 44 12, tab 3
button "Add", 21, 226 96 19 12, tab 3
button "Delete", 22, 250 96 28 12, tab 3
text "Channels", 23, 238 31 25 8, tab 3
text "New Movie Listings", 24, 62 52 50 8, tab 3
button "Cancel", 28, 243 185 37 12, cancel
button "OK", 29, 168 185 37 12, ok
button "HELP", 30, 5 185 37 12

this is basicly what i would like to do and look like. i want the script to wright the file with thr ules, exc stored and then activated when triggered.. as you can see there are milti setups in this dialog, i want to be able to edit three things from this file..... but i need some advice on how to blend it nicely and make it work..