fengshibang 5 Posted April 1, 2019 Share Posted April 1, 2019 In my server, the system will pop up the following text when botting, asking for the calculation formula and answer. In order to solve this problem, I want to make a plugin, now I need to know how to get text information and text events. Can someone help me, please Link to comment https://wrobot.eu/forums/topic/11013-how-to-get-text-from-chanel%EF%BC%9F/ Share on other sites More sharing options...
fengshibang 5 Posted April 2, 2019 Author Share Posted April 2, 2019 i really need your help.if you know,please tell me,thank you Link to comment https://wrobot.eu/forums/topic/11013-how-to-get-text-from-chanel%EF%BC%9F/#findComment-52445 Share on other sites More sharing options...
Droidz 2738 Posted April 3, 2019 Share Posted April 3, 2019 hello, tab "Chat" this text is display? if yes in what channel? Link to comment https://wrobot.eu/forums/topic/11013-how-to-get-text-from-chanel%EF%BC%9F/#findComment-52453 Share on other sites More sharing options...
fengshibang 5 Posted April 3, 2019 Author Share Posted April 3, 2019 It's the System Channel. When I turn off the System Channel Display, it's no longer displayed. Link to comment https://wrobot.eu/forums/topic/11013-how-to-get-text-from-chanel%EF%BC%9F/#findComment-52457 Share on other sites More sharing options...
fengshibang 5 Posted April 3, 2019 Author Share Posted April 3, 2019 4 hours ago, Droidz said: hello, tab "Chat" this text is display? if yes in what channel? It's the System Channel. When I turn off the System Channel Display, it's no longer displayed. Link to comment https://wrobot.eu/forums/topic/11013-how-to-get-text-from-chanel%EF%BC%9F/#findComment-52458 Share on other sites More sharing options...
Droidz 2738 Posted April 4, 2019 Share Posted April 4, 2019 If you use lua, you can try code like if DEFAULT_CHAT_FRAME then local c=DEFAULT_CHAT_FRAME:GetNumMessages() for i=1,c do local msg = DEFAULT_CHAT_FRAME:GetMessageInfo(i) if msg then YOUR CODE HERE end end end If message are display in WRobot tab "Chat" you can also use wrobot class Channel (sample: https://wrobot.eu/forums/topic/4802-mage-portal-bot/ ) Link to comment https://wrobot.eu/forums/topic/11013-how-to-get-text-from-chanel%EF%BC%9F/#findComment-52468 Share on other sites More sharing options...
fengshibang 5 Posted April 5, 2019 Author Share Posted April 5, 2019 19 hours ago, Droidz said: If you use lua, you can try code like if DEFAULT_CHAT_FRAME then local c=DEFAULT_CHAT_FRAME:GetNumMessages() for i=1,c do local msg = DEFAULT_CHAT_FRAME:GetMessageInfo(i) if msg then YOUR CODE HERE end end end If message are display in WRobot tab "Chat" you can also use wrobot class Channel (sample: https://wrobot.eu/forums/topic/4802-mage-portal-bot/ ) My version of the game is 2.4.3. This statement does not work properly:DEFAULT_CHAT_FRAME:GetMessageInfo(i).I checked some plug-ins written by others.His solution is to make a wow plug-in. This event "CHAT_MSG_SYSTEM" is used, and then the text is in arg1. How can wrobot extract arg1 to get the text? Link to comment https://wrobot.eu/forums/topic/11013-how-to-get-text-from-chanel%EF%BC%9F/#findComment-52484 Share on other sites More sharing options...
fengshibang 5 Posted April 5, 2019 Author Share Posted April 5, 2019 19 hours ago, Droidz said: If you use lua, you can try code like if DEFAULT_CHAT_FRAME then local c=DEFAULT_CHAT_FRAME:GetNumMessages() for i=1,c do local msg = DEFAULT_CHAT_FRAME:GetMessageInfo(i) if msg then YOUR CODE HERE end end end If message are display in WRobot tab "Chat" you can also use wrobot class Channel (sample: https://wrobot.eu/forums/topic/4802-mage-portal-bot/ ) --[[ Options start here ]] local M="CHAT_MSG_SYSTEM" function MS(msg) SendChatMessage(msg) end function yz() if (event==M) then local zj=string.find(arg1, "答题时间") if(zj) then end local s1=arg1 local zj=string.find(s1, "+") if(zj) then local s=arg1 local z="+" local y="?=" local param1, param2 = string.find(s, z) local m = string.len(s) s=string.sub(s,param2+1) local ts = string.reverse(s) local param1, param2 = string.find(ts, y) local m = string.len(s) - param2 + 1 local hou if (y == false) then hou = string.sub(s, m+1, string.len(s)) else hou = string.sub(s, 1-1, m-1) end local s=arg1 local z=":" local y="+" local param1, param2 = string.find(s, z) local m = string.len(s) s=string.sub(s,param2+1) local ts = string.reverse(s) local param1, param2 = string.find(ts, y) local m = string.len(s) - param2 + 1 local qian if (strchar == false) then qian = string.sub(s, m+11, string.len(s)) else qian = string.sub(s, 1+10, m-1) end print(qian,"+",hou,"=",qian+hou) MS(tostring(qian+hou)) else local s=arg1 local z="-" local y="?=" local param1, param2 = string.find(s, z) local m = string.len(s) s=string.sub(s,param2+1) local ts = string.reverse(s) local param1, param2 = string.find(ts, y) local m = string.len(s) - param2 + 1 local hou if (strchar == false) then hou = string.sub(s, m+1, string.len(s)) else hou = string.sub(s, 1-1, m-1) end local s=arg1 local z=":" local y="-" local param1, param2 = string.find(s, z) local m = string.len(s) s=string.sub(s,param2+1) local ts = string.reverse(s) local param1, param2 = string.find(ts, y) local m = string.len(s) - param2 + 1 local qian if (strchar == false) then qian = string.sub(s, m+10, string.len(s)) else qian = string.sub(s, 1+10, m-1) end print(qian,"-",hou,"=",qian-hou) MS(tostring(qian-hou)) end end end local F=CreateFrame("Frame") F:SetScript("OnEvent",yz) F:RegisterEvent(M) Droidz 1 Link to comment https://wrobot.eu/forums/topic/11013-how-to-get-text-from-chanel%EF%BC%9F/#findComment-52485 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now