mIRC Home    About    Download    Register    News    Help

Print Thread
#256977 06/03/16 11:47 AM
Joined: Mar 2016
Posts: 7
H
HHPN Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
H
Joined: Mar 2016
Posts: 7
Hey all. I have an idea and I'd appreciate your help making this.

I want to be able to use say something like

!A var1 var2 var3

and then when I say

!B, it'll output "var1 var2 var3 - last updated 10 seconds ago"

The variables will be constantly changing/updating as whoever can do a !A command. Is this possible?

Joined: Mar 2016
Posts: 6
I
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
I
Joined: Mar 2016
Posts: 6
must the user type !A "Hello world you" ?

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Please give some examples to make us understand better of what's var1/var2 you really mean, do you mean global variabls?, your description is poor.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Mar 2016
Posts: 7
H
HHPN Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
H
Joined: Mar 2016
Posts: 7
I want to be able to input something like...

Me: !place 52 10 degrees store

and then someone can say

Someone: !location

and it'll output

Output: 52 10 degrees store

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Use this code:

Code:
ON *:TEXT:*:#: {
  tokenize 32 $strip($1-)
  if ($1 == !place) {
    if (!$2) { .msg $chan ( $+ $nick $+ ): Please specify a text! | return }
    if (%place == $2-) { .msg $chan ( $+ $nick $+ ): Please specify an other text, it is the same as set now! | return }
    set %place $2-
    .msg $chan ( $+ $nick $+ ): Your place has been set as $qt($2-) $+ .
  }
  if ($1 == !location) {
    if (!%place) { .msg $chan ( $+ $nick $+ ): There is NOT any place set yet! }
    elseif (%place) { .msg $chan ( $+ $nick $+ ): The location is $qt(%place) $+ . }
  }
}


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Mar 2016
Posts: 7
H
HHPN Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
H
Joined: Mar 2016
Posts: 7
Any way to have this loop (in addition to calling it manually) every 10 seconds?

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
What exactly you mean? give some examples..


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Mar 2016
Posts: 7
H
HHPN Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
H
Joined: Mar 2016
Posts: 7
Your code works great. I want it to also be able to output the latest input every 10 seconds..

So like..

Manually call it with

Me: !place store
and then Someone can do

Someone: !location

Bot: store

Your script does this, but I want it to output "!location" every 10 seconds automatically without manually calling it. So after 10 seconds, it'll output

Bot: store
then 10 seconds later again

Bot: store

and then I can do !place job

and then 10 seconds later again it'll do

Bot: job

so on and so forth..

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Use this code:

Code:
ON *:TEXT:*:#: {
  tokenize 32 $strip($1-)
  if ($1 == !place) {
    if (!$2) { .msg $chan ( $+ $nick $+ ): Please specify a text! | return }
    if (%place == $2-) { .msg $chan ( $+ $nick $+ ): Please specify an other text, it is the same as set now! | return }
    set %place $2-
    .msg $chan ( $+ $nick $+ ): Your place has been set as $qt($2-) $+ .
    .timer[PLACE_SAY] 0 10 .msg $chan The location is $qt(%place) $+ .
  }
  if ($1 == !location) {
    if (!%place) { .msg $chan ( $+ $nick $+ ): There is NOT any place set yet! }
    elseif (%place) { .msg $chan ( $+ $nick $+ ): The location is $qt(%place) $+ . }
  }
}


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Mar 2016
Posts: 7
H
HHPN Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
H
Joined: Mar 2016
Posts: 7
Now with multiple "!place"'s in which the !location can output them all. As again, on a 10 second timer and also can be called manually whenever.

Input
!place outside
!store gap
!color blue

!location
outside
gap
blue

Joined: Mar 2016
Posts: 1
R
Mostly harmless
Offline
Mostly harmless
R
Joined: Mar 2016
Posts: 1
Need login of mirc


Link Copied to Clipboard