mIRC Homepage
Posted By: HHPN Not sure how to make this.. - 06/03/16 11:47 AM
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?
Posted By: Iyou Re: Not sure how to make this.. - 07/03/16 10:03 AM
must the user type !A "Hello world you" ?
Posted By: westor Re: Not sure how to make this.. - 07/03/16 07:23 PM
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.
Posted By: HHPN Re: Not sure how to make this.. - 08/03/16 08:04 AM
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
Posted By: westor Re: Not sure how to make this.. - 08/03/16 09:10 AM
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) $+ . }
  }
}
Posted By: HHPN Re: Not sure how to make this.. - 13/03/16 06:11 PM
Any way to have this loop (in addition to calling it manually) every 10 seconds?
Posted By: westor Re: Not sure how to make this.. - 13/03/16 07:31 PM
What exactly you mean? give some examples..
Posted By: HHPN Re: Not sure how to make this.. - 14/03/16 08:20 AM
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..
Posted By: westor Re: Not sure how to make this.. - 14/03/16 09:16 AM
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) $+ . }
  }
}
Posted By: HHPN Re: Not sure how to make this.. - 14/03/16 10:03 PM
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
Posted By: richie Re: Not sure how to make this.. - 20/03/16 12:58 PM
Need login of mirc
© mIRC Discussion Forums