Jump to content




Emailing program


  • You cannot reply to this topic
10 replies to this topic

#1 scarface7454

  • New Members
  • 5 posts

Posted 22 November 2012 - 07:51 AM

so im working on an emailing program for me and my friends to use on our private server. i guess im using lua....

now im using 2 seperate computers both with wireless modems as test dummies. right now i have my code to prompt the user to type in their message, then they are prompted to put in the ID to be sent to.


it seems i cant get the program to read the number thats punched for the ID or im entering the ID wrong(?) the 24 i know signifies the line of code thats bugged.

here is that line:

id = to number (id)

if need be ill learn how to add spoilers and put the whole script in.

the purpose of this thread was for one problem and now i feel like im flooding :X


i dont see many email threads up for this kind of program so im going to post my code WiP that needs some major help lol.

im now stuck at getting the message to load on the other computer. as far as i know its sending now but i cant receive, i think that part of my code needs work.

Spoiler


#2 bjornir90

  • Members
  • 378 posts
  • LocationFrance

Posted 22 November 2012 - 08:00 AM

View Postscarface7454, on 22 November 2012 - 07:51 AM, said:

so im working on an emailing program for me and my friends to use on our private server. i guess im using lua....

right now im using 2 seperate computers both with wireless modems as test dummies. right now i have my code to prompt the user to type in their message, then they are prompted to put in the ID to be sent to.

and thats where I get email 24 attempt to call nil

it seems i cant get the program to read the number thats punched for the ID or im entering the ID wrong(?) the 24 i know signifies the line of code thats bugged.

here is that line:

id = to number (id)

if need be ill learn how to add spoilers and put the whole script in.
It's tonumber() without spaces :(/>

#3 Zudo

  • Members
  • 800 posts
  • LocationUK

Posted 22 November 2012 - 08:04 AM

to do a spoiler do
(in square brackets not rounded):
(spoiler)
STUFF
(/spoiler)
Example
Spoiler


#4 scarface7454

  • New Members
  • 5 posts

Posted 22 November 2012 - 08:18 AM

thank you guys :(/>

bad arguement #1: value expected?

:X

im not sure why its not reading the value i type in....

here is the string
if key == "1" then
  clear()
  write("Message: ")
  text = read()
  write("ID to send to: ")
  id = read()
  id = tonumber()
  rednet.send( id, text)
  print("Message Sent")
  sleep(1)
  shell.run("email")

is it because text - read() and id = read() ?

#5 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 22 November 2012 - 08:38 AM

Have you declared 'key'?
and do:
id = tonumber(read())


#6 scarface7454

  • New Members
  • 5 posts

Posted 22 November 2012 - 08:39 AM

You'll have to excuse me lack of knowledge but what do you mean declared "key"? and ill try that second park remiX

#7 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 22 November 2012 - 08:44 AM

Well you're comparing key with "1". But what is 'key'?

#8 scarface7454

  • New Members
  • 5 posts

Posted 22 November 2012 - 08:50 AM

keyboard keys as far as i understand. and how it seems to be working.

#9 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 22 November 2012 - 08:55 AM

Oh then you need to use os.pullEvent()

e, p1 = os.pullEvent()
if e == "key" and p1 == keys.x   -- So this will only trigger if you click 'x'
   term.clear()
   term.setCursorPos(1,1)
   write("Message: ")
   text = read()
   write("ID to send to: ")
   id = tonumber(read())
   rednet.send(id, text)
   print("nMessage Sent")
   sleep(1)
   shell.run("email")
end


#10 billysback

  • Members
  • 569 posts

Posted 22 November 2012 - 09:09 AM

As said before, please put your code in code brackets:
[code]
<code>
[*/code]
(no *)

Just makes it easier for people to help you :(/>

#11 scarface7454

  • New Members
  • 5 posts

Posted 22 November 2012 - 09:13 AM

im so sorry im lost to all this, call me mega nub of the day. thank you for not being harsh on me though.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users