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

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Post Reply
Message
Author
User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

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

#1 Post by jduartedj » Sun Jan 16, 2011 8:51 pm

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
Attachments
addon_gameText.lua
V1.0
(2.28 KiB) Downloaded 282 times
Last edited by jduartedj on Sun Jan 16, 2011 9:11 pm, edited 1 time in total.
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

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

#2 Post by rock5 » Sun Jan 16, 2011 9:04 pm

To paraphrase you;
jduartedj wrote:What file? xD

You probably should include the file!
:)

I can see this making a few people happy.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

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

#3 Post by jduartedj » Sun Jan 16, 2011 9:11 pm

LOL, I forgot! xD
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

squeekthegeek
Posts: 25
Joined: Mon Nov 08, 2010 1:50 pm

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

#4 Post by squeekthegeek » Tue Mar 29, 2011 10:39 am

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.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

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

#5 Post by lisa » Tue Mar 29, 2011 1:09 pm

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.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

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

#6 Post by rock5 » Tue Mar 29, 2011 7:42 pm

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.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

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

#7 Post by BillDoorNZ » Thu Aug 11, 2011 6:27 am

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 :(

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests