|
Joined: Nov 2014
Posts: 27
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2014
Posts: 27 |
Hi all, I would like to know if any word can be made with autocomplete. For example:
I really like drinking Heineken , and I do not like []Corona[] .
But, that certain words are autocompleted, others do not
It's possible?
|
|
|
|
Joined: May 2017
Posts: 14
Pikka bird
|
Pikka bird
Joined: May 2017
Posts: 14 |
I don't understand. As far as I know, tab-completion only "auto"-completes nick names.
Happy license owner.
|
|
|
|
Joined: Nov 2014
Posts: 27
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2014
Posts: 27 |
If I write Heineken in black, let the remote be in blue
But the word Heineken is not a nickname
Certain words other than nickname are autocompleted once the enter is pressed
|
|
|
|
Joined: Nov 2014
Posts: 27
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2014
Posts: 27 |
<@nexux> I like Heineken but I do not like Corona <marisol42> Yes, it's true, Heineken is very rich <@nexux> marisol42 you have to try drinking the heineken
|
|
|
|
Joined: Nov 2014
Posts: 27
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2014
Posts: 27 |
On *:Input:*: {
If ($left($1,1) != /) && (!$Ctrlenter) { msg $active $replace($1-,heineken, heineken) | halt }
}
|
|
|
|
Joined: Nov 2014
Posts: 27
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2014
Posts: 27 |
But I can not put two colors: 3,1 for example:
On *:Input:*: {
If ($left($1,1) != /) && (!$Ctrlenter) { msg $active $replace($1-,heineken, 3,1Heineken, corona, 4corona) | halt }
}
* Invalid parameters: $replace (line 3, remote.ini)
|
|
|
|
Joined: Jan 2004
Posts: 2,127
Hoopy frood
|
Hoopy frood
Joined: Jan 2004
Posts: 2,127 |
The replace is seeing the commas from your color codes. Take a look at the syntax for $replace, and you'll see it's like: $replace(text,look for this, replace with this, look for this too, replace 2nd text with this). So $replace is seeing your commas as the border between replaced and replacement strings. Invalid sequence for replace() is to have an odd number of comma-separated strings following the text string that's having replacements made against it.
Instead of having 3,1 inside the parenthesis, you should instead have: 3 $+ $chr(44) $+ 1
As long as you're guaranteed to not have the color numbers not touching numbers to be displayed, you won't have to worry about making sure the numbers are zero padded to be 2 digits, like 03
Another issue is just personal preference, but many people find it hard to read characters were the background to the left of the 1st letter and to the right of the last letter is a different color. So instead of doing
8,4Heineken
you might want to do
8,4 Heineken
When coloring the entire line, the stray control-c at the end makes sure the last letter has the same color space appearing after it.
Edit: clarifying that it's legit to have commas inside replace() as long as they belong to other identifiers(). So you can have something like: $replace(text,$gettok(text,1,32),newtext) and it won't see the portions of the $gettok() as several search/replace strings.
Last edited by maroon; 11/05/17 01:11 AM. Reason: clarify about commas inside replace()
|
|
|
|
Joined: Nov 2014
Posts: 27
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2014
Posts: 27 |
Thank you very much! It worked for me! But, if I want to add more colors and more shapes?
|
|
|
|
Joined: Jul 2014
Posts: 34
Ameglian cow
|
Ameglian cow
Joined: Jul 2014
Posts: 34 |
you could use variables, like so:
var %heineken = HERE_SOME_STUFF
$replace($1-,heineken,%heineken)
|
|
|
|
Joined: Nov 2014
Posts: 27
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2014
Posts: 27 |
Thank you very much! It worked for me! But, And if I want to put these symbols for example:
;
,
.
^^
^^,
:P
:)
:(
:O
-.- And any other kind of symbol?
Last edited by nexux; 12/05/17 11:38 AM. Reason: But, And if I want to put these symbols for example: Code:
|
|
|
|
Joined: Nov 2014
Posts: 27
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2014
Posts: 27 |
This way is okay?
On *:Input:*: {
;===[ words
var %heineken = 0,3 heineken
var %cafe = 0 $+ $chr(44) $+ 5 cafe
var %hiphop = 13 $+ $chr(44) $+ 6 HipHop
var %Buenosdias = 3Buenos dias
;===[ symbols
var %t1 = :)
var %t2 = 4:)
var %t3 = ^^
var %t4 = 7^^
var %t5 = -.-
var %t6 = 6 -.-
If ($left($1,1) != /) && (!$Ctrlenter) { msg $active $replace($1-,heineken,%heineken,cafe,%cafe,hiphop,%hiphop,Buenos dias,%buenosdias,!,7!,?,4?,%t1,%t2,%t3,%t4,%t5,%t6) | halt }
}
|
|
|
|
|