Posted 03 January 2015 - 02:59 AM
<p>I am making an Emailing Client/Server and There is an annoying little problem, I want a while true do loop, where it is constantly checking for rednet signals, but I want it to do things OVER that process, so, it will be constantly checking, while you can press &#39;E&#39; for creating an Email Message, here is my code.<br />
so yeah, can anyone help me?<br />
EDIT:<br />
New Problem:<br />
I get the &quot;Type &#39;E&#39; to send Email Message&quot; thing again, when I send a message to the other client, help, please?<br />
</p>
<p>I hope this is my last problem. But, Reply doesn&#39;t work…At All, if I press reply and then reply to the person, The emails will no longer go through…..if you need the code for the server, I&#39;ll give you that too, but, here is the code.</p>
<p>
<p>
<div></div>
<div>Any Suggestions?</div>
<br />
rednet.open(&quot;back&quot;)<br />
while true do<br />
-- Check rednet signals using rednet.receive or something<br />
print(&quot;Type &#39;E&#39; to send email message&quot;)<br />
local thing = read()<br />
if thing == &quot;E&quot; then<br />
print(&quot;Email What&quot;)<br />
local Word = read()<br />
rednet.send(1, Word) -- 1 is the server<br />
end<br />
term.clear()<br />
end<br />
<br />so yeah, can anyone help me?<br />
EDIT:<br />
New Problem:<br />
I get the &quot;Type &#39;E&#39; to send Email Message&quot; thing again, when I send a message to the other client, help, please?<br />
Spoiler
<br /><br />
term.clear()<br />
term.setCursorPos(1, 1)<br />
rednet.open(&quot;back&quot;)<br />
print(&quot;What will your name be?&quot;)<br />
local Name = read()<br />
rednet.send(1, &quot;/name/&quot;)<br />
rednet.send(1, Name)<br />
while true do<br />
print(&quot;Type &#39;E&#39; to send Email Message or R to exit out&quot;)<br />
local e, p1 = os.pullEvent()<br />
if e == &quot;key&quot; and p1 == keys.e then<br />
print(&quot;Email what: &quot;)<br />
local Word = read()<br />
rednet.send(1, Word)<br />
elseif e == &quot;rednet_message&quot; then<br />
id, msg = rednet.receive()<br />
term.clear()<br />
term.setCursorPos(1, 1)<br />
print(msg)<br />
print(&quot;Type any key to go back to Emails&quot;)<br />
read()<br />
elseif e == &quot;key&quot; and p1 == keys.r then<br />
break<br />
end<br />
end<br />
rednet.close()<br />
<br /><p>I hope this is my last problem. But, Reply doesn&#39;t work…At All, if I press reply and then reply to the person, The emails will no longer go through…..if you need the code for the server, I&#39;ll give you that too, but, here is the code.</p>
<p>
Spoiler
</p><p>
</p>
<div>term.clear()</div>
<div>term.setCursorPos(1, 1)</div>
<div>rednet.open(&quot;back&quot;)</div>
<div>print(&quot;What will your name be?&quot;)</div>
<div>local Name = read()</div>
<div>rednet.send(1, &quot;/name/&quot;)</div>
<div>rednet.send(1, Name)</div>
<div>while true do</div>
<div>term.clear()</div>
<div>term.setCursorPos(1, 1)</div>
<div>print(&quot;Type &#39;E&#39; to send Email Message or R to exit out&quot;)</div>
<div>local e, p1, msg = os.pullEvent()</div>
<div>if e == &quot;key&quot; and p1 == keys.e then</div>
<div>print(&quot;Email what: &quot;)</div>
<div>local Word = read()</div>
<div>rednet.send(1, Word)</div>
<div>elseif e == &quot;rednet_message&quot; then</div>
<div>term.clear()</div>
<div>term.setCursorPos(1, 1)</div>
<div>print(msg)</div>
<div>term.setCursorPos(1, 6)</div>
<div>print(&quot;------------&quot;)</div>
<div>print(&quot;Press &#39;E&#39; to go to Emails, or &#39;Y&#39; to reply&quot;)</div>
<div>f, p2 = os.pullEvent()</div>
<div>if f == &quot;key&quot; and p2 == keys.y then</div>
<div>print(&quot;------------&quot;)</div>
<div>print(&quot;What to reply?&quot;)</div>
<div>local Reply = read()</div>
<div>rednet.send(1, &quot;/reply/&quot;)</div>
<div>rednet.send(1, Reply)</div>
<div>elseif f == &quot;key&quot; and p2 == keys.e then</div>
<div>term.clear()</div>
<div>term.setCursorPos(1, 1)</div>
<div>end</div>
<div>elseif e == &quot;key&quot; and p1 == keys.r then</div>
<div>break</div>
<div>end</div>
<div>end</div>
<div>rednet.close()</div>
<div>
</div><div>
<div>Any Suggestions?</div>
Edited on 03 January 2015 - 02:38 PM