mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2004
Posts: 45
N
Navid Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Feb 2004
Posts: 45
Hello.
I have been working on a bot and I found out how tiring it can be to change the ` in all of the scripts in the bot (there is a lot) and so I was wondering if there was a way I can like do this
on 1:text:%tregister:#:
%t = `
instead of changing the trigger for everysingle command, that would make it much easyier.
Any other way works as well, any ideas smile
~Thanks for reading/replying smile

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
If you're changing the trigger command from ` to something else (eg: !), then use the Find Text button in the mIRC Script Editor. It has Find & Replace option, as well as being able to search through all of the loaded scripts.

Joined: Feb 2004
Posts: 45
N
Navid Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Feb 2004
Posts: 45
Yea, I know about that, but if I replace all the ` to ! il will not only change the trigger but every phrase that has a ` in it it will.
I've used this before and havent been satisfied with it though.

Joined: Dec 2002
Posts: 208
H
Fjord artisan
Offline
Fjord artisan
H
Joined: Dec 2002
Posts: 208
on 1:text:$(%t $+ register):#:


If I knew now what I will know then... maybe things will have been different...
Joined: Feb 2004
Posts: 45
N
Navid Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Feb 2004
Posts: 45
Thanks Hrung. I dont have the time right now, but tomorrow morning I'll give it a try.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Just as a note, you can replace text with a better search.

Don't search for `, but search for :text:`. Then, you just run the search on the various event types (text, input, etc) that you use.


Invision Support
#Invision on irc.irchighway.net
Joined: Feb 2004
Posts: 45
N
Navid Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Feb 2004
Posts: 45
What Hrung gave me worked perfectly.Thanks.
So, I tried changing it a bit. I made it:

on *:TEXT:$($stats($nick,Digital,Trigger) $+ stats):#: {

And it doesnt, work. Any ideas on how I can fix it?. the $stats works fine, i use it in other corners of the bot.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Using $() to combine things requires a comma, not a $+

Assuming your $stats thing returns a value, you can use:

on *:TEXT:$($stats($nick,Digital,Trigger),stats):#: {

If the $stats returned Test, then the trigger would be Teststats. Sometimes it's best to also have a period to separate the combined information so it looks better.

on *:TEXT:$($stats($nick,Digital,Trigger),.stats):#: {

This would result in Test.stats if $stats returned Test.


Invision Support
#Invision on irc.irchighway.net
Joined: Feb 2004
Posts: 45
N
Navid Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Feb 2004
Posts: 45
I tried:
on *:TEXT:$($stats($nick,Digital,Trigger),stats):#: {

it doesnt work and same for the other command.
the $stats($nick,Digital,Trigger) returns the value "!"

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Oops... heh. It should be $+($stats($nick,Digital,Trigger),stats)

forgot the +.


Invision Support
#Invision on irc.irchighway.net
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Quote:

the $stats($nick,Digital,Trigger) returns the value "!"

you need to look at the alias for $stats then, my guess is the ! is the normal result for trigger

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
He wants that. smile

He wants to be able to just change the trigger character in his file and call it good. So, he could change one file from using ! to using ~ to using + to anything else and it would switch all his triggers appropriately.


Invision Support
#Invision on irc.irchighway.net
Joined: Feb 2004
Posts: 45
N
Navid Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Feb 2004
Posts: 45
Sorry Riamus2 but that didnt work either.
I made a new alias:
trigger {
var %t = $nick
return $stats(%t,Digital,Trigger)
}
maybe I can use the $trigger instead of the $stats in there.

and here is the alias for $stats
stats {
return $readini(Members\ $+ $1 $+ .DGT,$2,$3)
}

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
Using $() to combine things requires a comma, not a $+

I dont think so.

//echo -a $($me,.stats)
DaveC .stats
//echo -a $($+($me,.stats))
DaveC.stats

In the on text usage the $() simple encapsulates the matchtext, you still need to join the parts correctly.

In normal use it gets used to as the short hand command of $eval, oddly $( and $eval take as many parameters as you like, the first is evaluated the number of times of the last one assuming the last one is a number.

//echo -a $($me,$me)
DaveC DaveC
//echo -a $($me,$me,0)
$me DaveC
//echo -a $($me,$me,1+)
DaveC DaveC

Joined: Feb 2004
Posts: 45
N
Navid Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Feb 2004
Posts: 45
Heh Sorry DaveC but I dont really understand ya smile.
I tried a lot of other stuff including asking in scripting channels on irc and appearently nobody can explain lol smile.

I guess, everyone's out ot ideas blush

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
My reply wasnt to you it was about something someone else said.

Any way, ill read the following....
Quote:
I have been working on a bot and I found out how tiring it can be to change the ` in all of the scripts in the bot (there is a lot) and so I was wondering if there was a way I can like do this
on 1:text:%tregister:#:
%t = `
instead of changing the trigger for everysingle command, that would make it much easyier.
Any other way works as well, any ideas smile


Alright, let me getr this straight, the code has soemthing like
on *:TEXT:!register:#:{ ..... }
on *:TEXT:!quote:#:{ ..... }
on *:TEXT:!blah *:#:{ ..... }

and you would like to change it to
on *:TEXT:`register:#:{ ..... }
on *:TEXT:`quote:#:{ ..... }
on *:TEXT:`blah *:#:{ ..... }

but later you mighty wanty to change to something else again like
on *:TEXT:@register:#:{ ..... }
on *:TEXT:@quote:#:{ ..... }
on *:TEXT:@blah *:#:{ ..... }

if this is the case, then change it once to this
alias trigger.prefix return @
on *:TEXT:$($+($trigger.prefix,register)):#:{ ..... }
on *:TEXT:$($+($trigger.prefix,quote)):#:{ ..... }
on *:TEXT:$($+($trigger.prefix,blah *)):#:{ ..... }

this well mena you simple change
alias trigger.prefix return @
to
alias trigger.prefix return !
or
alias trigger.prefix return `
etc

PS: if all the triggers are in the same file then use
alias -l trigger.prefix return `
^ placing that in the same file of course!

this well allow only that file to access that trigger prefix, aka you can use another one in another file.

Joined: Feb 2004
Posts: 45
N
Navid Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Feb 2004
Posts: 45
Thanks DaveC, but it didnt quiet workout.
So I ended up using this smile
on *:TEXT:*stats*:#::{ if ($1 == $+($stats($nick,digital,trigger),stats)) {

Lol, big but yea works smile thanks for helping again guys.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
DaveC ... I was responding to how he had it written...

He had basically: $(item1 $+ item2) which is why I said he needed a comman instead. I noted on the following post I did that I forgot to include the + in the beginning.

Just as a question... Is there a difference between:

$+(item1,.item2)

and

$($+(item1,.item2))

You are saying to use the second one, but doesn't the first do the same thing?


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard