Page 1 of 1

Umlauts

Posted: Wed Sep 02, 2009 7:22 am
by master121
Is there a way to use umlauts ??
MicroMacro doesn´t like the ä in this code...

itemName = "Beutel mit verbesserten Wurfäxten"

Re: Umlauts

Posted: Wed Sep 02, 2009 7:52 am
by d003232
master121 wrote:Is there a way to use umlauts ??
MicroMacro doesn´t like the ä in this code...

itemName = "Beutel mit verbesserten Wurfäxten"
It depends from what you want to do. For a clear printou use:

Code: Select all

itemName = "Beutel mit verbesserten Wurf\132xten"
.

For using Ingame informations in lua you need perhaps

Code: Select all

convert_utf8_ascii( text );
or could it be, that you need the other way around? Then you have to change that function to the other direction?

Re: Umlauts

Posted: Wed Sep 02, 2009 7:58 am
by Administrator
Use the extended ASCII table to find the decimal representation, and escape it with the \ character as d003232 has shown.

'ä' = 132 dec., so 'a' == '\132'

Re: Umlauts

Posted: Wed Sep 02, 2009 8:36 am
by master121
I want to use this code :

Code: Select all

itemName = "Beutel mit verbesserten Wurf\132xten"
for k = 1, 60, 1 do
    local bagid, icon, name, itemCount = RoMScript("GetBagItemInfo("..k..");");
    if (itemName == name) then
       itemTotal = itemTotal + itemCount;
    end
end

Re: Umlauts

Posted: Wed Sep 02, 2009 8:39 am
by d003232
master121 wrote:I want to use this code :

Code: Select all

itemName = "Beutel mit verbesserten Wurf\132xten"
for k = 1, 60, 1 do
    local bagid, icon, name, itemCount = RoMScript("GetBagItemInfo("..k..");");
    if (itemName == name ) then
       itemTotal = itemTotal + itemCount;
    end
end
Try

Code: Select all

temName = "Beutel mit verbesserten Wurf\132xten"
for k = 1, 60, 1 do
    local bagid, icon, name, itemCount = RoMScript("GetBagItemInfo("..k..");");
    if (itemName == convert_utf8_ascii( name ) ) then
       itemTotal = itemTotal + itemCount;
    end
end

Re: Umlauts

Posted: Fri Sep 04, 2009 5:38 am
by 3cmSailorfuku
master121 wrote:I want to use this code :

Code: Select all

itemName = "Beutel mit verbesserten Wurf\132xten"
for k = 1, 60, 1 do
    local bagid, icon, name, itemCount = RoMScript("GetBagItemInfo("..k..");");
    if (itemName == name) then
       itemTotal = itemTotal + itemCount;
    end
end
For your information, this is not the official runes of magic forum. If you have issues with your plugin that uses the RoM API you should get support there.

Re: Umlauts

Posted: Fri Sep 04, 2009 5:50 am
by d003232
3cmSailorfuku wrote:
master121 wrote:I want to use this code :

Code: Select all

itemName = "Beutel mit verbesserten Wurf\132xten"
for k = 1, 60, 1 do
    local bagid, icon, name, itemCount = RoMScript("GetBagItemInfo("..k..");");
    if (itemName == name) then
       itemTotal = itemTotal + itemCount;
    end
end
For your information, this is not the official runes of magic forum. If you have issues with your plugin that uses the RoM API you should get support there.
Aua. Be not so hard with him! :-)

It is a problem with the bot and the new Bot RoMScript macro function. The conversion between the ingame UTF8 informations and the ASCII handling in the bot. So it is ok to ask that here.

Re: Umlauts

Posted: Fri Sep 04, 2009 7:53 pm
by 3cmSailorfuku
d003232 wrote:
3cmSailorfuku wrote:
master121 wrote:I want to use this code :

Code: Select all

itemName = "Beutel mit verbesserten Wurf\132xten"
for k = 1, 60, 1 do
    local bagid, icon, name, itemCount = RoMScript("GetBagItemInfo("..k..");");
    if (itemName == name) then
       itemTotal = itemTotal + itemCount;
    end
end
For your information, this is not the official runes of magic forum. If you have issues with your plugin that uses the RoM API you should get support there.
Aua. Be not so hard with him! :-)

It is a problem with the bot and the new Bot RoMScript macro function. The conversion between the ingame UTF8 informations and the ASCII handling in the bot. So it is ok to ask that here.
Uh uh, am I missing something? RoM API can be accessed from micromacro? wat

And that LUA is not reading the scripts in UTF-8 is obvious (Not natively), it's even in the FAQ here.

Re: Umlauts

Posted: Fri Sep 04, 2009 8:11 pm
by droppen
just look at inventory.lua, it has these function's pre coded.