Page 1 of 1

ingame message printing... --> [gameText]

Posted: Sun Jan 16, 2011 8:51 pm
by jduartedj
Here I am, again!

bringing to you a somewhat useful function, It has a complex usage but it also supports all kinds of ingame message printing I can think of!
Behold.... gameText!

Code: Select all

USAGE: gameText(msg[,kind,channel,color,item])
the following kinds are available: SAY, ZONE, YELL, WORLD, GUILD, RAID, PARTY, WHISPER, CHANNEL, SYSTEM, WARNING, SYSCHAT, MSG
note: unlike all other args, kind must be passed in caps.

Bear in mind this was designed for both simplicity AND functionality, so I'll provide examples from the simplest to msot functional.

Code: Select all

gameText("Hello World")
writes the message "Hello Word" in the ingame chat window in message regular color, standard is a dark yellow. (Same as gameText("Hello World","MSG")

Code: Select all

gameText("Goodbye Cruel World","WHISPER","[GM]Bothater")
will whisper "Goodbye Cruel World" to "[GM]Bothater". At the moment the "CHANNEL" kind isn't working but usage is similar

Code: Select all

gameText("Mass Suicide Anyone?","CHANNEL",1)
will write in private channel 1: "Mass Suicide Anyone?". The channel arg is only use in these 2 cases.

Code: Select all

gameText("This is a sad day!","ZONE",nil,"gold")
will write "This is a sad day!" in the zone channel in gold color. the color argument takes a color name from the local colors table or a color hex string. Currently the following colors are indexed:

Code: Select all

colors = {
	white =  "ffffff",
	green =  "00ff00",
	blue =   "0072bc",
	purple = "a864a8",
	orange = "f68e56",
	gold =   "a37d50",
	yellow = "ffff00",
	red =    "ff0000",
};
if you want gray for example, you have to pass "cccccc" as color and not "gray" because "gray" isn't on this table, if you do so the message will be written with code errors. You can use the color argument with ANY kind of message but if you don't it'll use default color.

You can also use Item Links inside the message with ANY kind of message! at the moment it is limited to 1 link, to do so just include "ITEM" in your message:

Code: Select all

gameText("My armor is sweet!--> ITEM right?","WORLD",nil,"red","God's  Breasts")
will write "My armor is sweet!--> [God's Breasts] right?" in red to world chat (YELL and WORLD are both the same kind) the text will be red but the item has its own color. Also the item argument can search an item in your inventory by name or ID or you can just pass a CItem object to it:

Code: Select all

gameText("My armor is sweet!--> ITEM right?","WORLD",nil,"red",inventory:findItem("God's  Breasts"))
will also work(as proof of concept in this case).

RAID and PARTY kinds are the same also and are used like ZONE or WORLD.

The SYSTEM and WARNING print an onscreen message, unlike the other kinds the message is displayed in the middle of the screen instead of chat box. work with different colors and itemlink and the default to yellow and red colors respectively.

The SYSCHAT kind prints a system-like message to the chat box, as far as I can tell It is only different from MSG in it's default color, which is orange.

Enjoy!!! :D

EDIT: if anyone has any suggestion as for CHANNEL problem I'm glad to take it, I think we have to be channel managers :S

Re: ingame message printing... --> [gameText]

Posted: Sun Jan 16, 2011 9:04 pm
by rock5
To paraphrase you;
jduartedj wrote:What file? xD

You probably should include the file!
:)

I can see this making a few people happy.

Re: ingame message printing... --> [gameText]

Posted: Sun Jan 16, 2011 9:11 pm
by jduartedj
LOL, I forgot! xD

Re: ingame message printing... --> [gameText]

Posted: Tue Mar 29, 2011 10:39 am
by squeekthegeek
Hi, i was wondering if there was a way we could make the bot look for a specific string in partychat? That would be a pretty handy function as it could make multiple bots synchronize attacks, buffs...

What i have in mind is 6 bots running on different computers farming first boss of Dungeon of Dalanis all day for mementos. I'm talking about 3 OP scouts and 3 healers botting all day.

Thanks.

Re: ingame message printing... --> [gameText]

Posted: Tue Mar 29, 2011 1:09 pm
by lisa
squeekthegeek wrote:Hi, i was wondering if there was a way we could make the bot look for a specific string in partychat? That would be a pretty handy function as it could make multiple bots synchronize attacks, buffs...

What i have in mind is 6 bots running on different computers farming first boss of Dungeon of Dalanis all day for mementos. I'm talking about 3 OP scouts and 3 healers botting all day.

Thanks.
A little of topic but my party bot is running pretty smoothly atm, still testing it but I should be able to post it by the weekend, if I don't get caught up with other stuff.

Re: ingame message printing... --> [gameText]

Posted: Tue Mar 29, 2011 7:42 pm
by rock5
Monitoring chat has been suggested/ask for before. The reason it was never pursued is because rombot can't monitor events. That would require an in game addon.

Re: ingame message printing... --> [gameText]

Posted: Thu Aug 11, 2011 6:27 am
by BillDoorNZ
it could be worth adding some code to escape the single quotes (') so it doesn't break the macro call. I just started using this as I play at work so can't read the chat mesages (window is tiny). I have a .Net app with a UDP server in it that I then use a timer + luasocket library to send all chats & channels to and then the reverse the other way and just figured out why it was failing- I was sending messages with quotes in them :(