Special ALT code Characters need help

All about the macro plugin can be found in this forum. This forum is intended for the macro plugin only.

Moderator: Moderators

genuineopenkore
Plain Yogurt
Plain Yogurt
Posts: 52
Joined: 16 Jan 2011, 03:06
Noob?: Yes

Special ALT code Characters need help

#1 Post by genuineopenkore »

how to make macro support Special ALT code Characters like:

è = ALT 138
™ = ALT 0153
½ = ALT 171
etc... http://www.tedmontgomery.com/tutorial/altchrc.html

because my bot crashes when encounters "è"

automacro pm {
pm "test"
exclusive 1
call {
do c Lémon
stop
}
}
genuineopenkore
Plain Yogurt
Plain Yogurt
Posts: 52
Joined: 16 Jan 2011, 03:06
Noob?: Yes

Re: Special ALT code Characters need help

#2 Post by genuineopenkore »

genuineopenkore wrote:how to make macro support Special ALT code Characters like:

è = ALT 138
™ = ALT 0153
½ = ALT 171
etc... http://www.tedmontgomery.com/tutorial/altchrc.html

because my bot crashes when encounters "è"

automacro pm {
pm "test"
exclusive 1
call {
do c Lémon
stop
}
}
error.txt
Error message:
Malformed UTF-8 character (fatal) at plugins/Macro/Parser.pm line 44, <$fp> line 21.

Stack trace:
Malformed UTF-8 character (fatal) at plugins/Macro/Parser.pm line 44, <$fp> line 21.
at src/Misc.pm line 4246
Misc::parseReload('macro') called at src/Commands.pm line 3781
Commands::cmdReload('reload', 'macro') called at src/Commands.pm line 285
Commands::run('reload macro') called at src/functions.pl line 976
main::parseInput('reload macro') called at src/functions.pl line 62
main::mainLoop() called at src/Interface.pm line 75
Interface::mainLoop('Interface::Console::Win32=HASH(0x1217f04)') called at openkore.pl line 97
main::__start() called at start.pl line 136
line 44 on plugins/Macro/Parser.pm
s/\s*[\r\n]?$//g; # remove trailing whitespaces and eol


opsss! sorry for double posting
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: Special ALT code Characters need help

#3 Post by EternalHarvest »

macros.txt must be in UTF-8.
genuineopenkore
Plain Yogurt
Plain Yogurt
Posts: 52
Joined: 16 Jan 2011, 03:06
Noob?: Yes

Re: Special ALT code Characters need help

#4 Post by genuineopenkore »

solved!

thanks EternalHarvest
vespercore02
Noob
Noob
Posts: 18
Joined: 15 Nov 2010, 11:40
Noob?: No

Re: Special ALT code Characters need help

#5 Post by vespercore02 »

save as type all?
encoding utp-8?

is it right?
willsnake
Noob
Noob
Posts: 8
Joined: 14 Feb 2012, 07:10
Noob?: Yes

Re: Special ALT code Characters need help

#6 Post by willsnake »

Hi,

may i ask if how can the macro recognize names with backslash? "\"

this is my macros.txt also in UTF-8

automacro b {
console /(.*) \(level (\d*)\) Requests a Deal/
call {
do deal
$name = $.lastMatch1
do pm "$name" "Mosco 2.9k"
do pm "$name" "Rachel 3k"
do pm "$name" "Kobold 2k"
do pm "$name" "Veinstown 2.4k"
pause 15
do deal no
do sit
}
}

it cant pm names like "I/\m"