Jump to content


Rwkeith's Content

There have been 13 items by Rwkeith (Search limited from 10-February 22)


By content type

See this member's

Sort by                Order  

#137028 Help With Counting

Posted by Rwkeith on 30 July 2013 - 02:01 PM in Ask a Pro

There are several ways to do this. I would start with some tutorials.



#73683 [1.4.5] NPaintPro

Posted by Rwkeith on 13 January 2013 - 10:40 AM in Programs

Nitrogen Fingers hasn't updated the link yet.



#72371 [API] Mouse and graphic api V1.6.1 beta. Easy to use GUI API with full mouse...

Posted by Rwkeith on 11 January 2013 - 08:29 AM in APIs and Utilities

Is it possible to draw an image to the screen?



#70272 [API] Mouse and graphic api V1.6.1 beta. Easy to use GUI API with full mouse...

Posted by Rwkeith on 07 January 2013 - 07:01 AM in APIs and Utilities

Very nice man. Keep up the work. P.S. I got BF3 too for christmas(xbox) =D



#70242 The Mouse-Events

Posted by Rwkeith on 07 January 2013 - 05:51 AM in Tutorials

Good simple tutorial for starting a GUI.



#70221 [Lua] Slight problem with my Decrypted output

Posted by Rwkeith on 07 January 2013 - 05:06 AM in Ask a Pro

View Postimef, on 06 January 2013 - 03:51 PM, said:

Here's a corrected part of the code :
Spoiler


The Problem came from the statement : "keyTable[t] = string.byte(keyTable[t])" in the encryption loop.
This instruction is executed "size" times in the non corrected version whereas it should be done only "ksize" times.

Why only the beginning of the text was affected remains a mystery to me.

Thanks a ton for catching that :D



#69942 [Lua] Slight problem with my Decrypted output

Posted by Rwkeith on 06 January 2013 - 12:36 PM in Ask a Pro

My code syntax is fine. The problem is the output. This program does a simple xor encryption/Decryption with a text string and a key provided. It prints out the decrypted/encrypted text. The output however is messed up.

Just the first few characters of my decrypted string is not right. The rest of my string is intact. The longer my key is, the longer the incorrect characters.


--Let's see here
--This might work..
textTable = {}
keyTable = {}
readFile = fs.open("log","r")
text = readFile.readAll()
readFile.close()
print("Unencrypted:")
write(text.."\n")
--Inialize tables
size = string.len(text)
for o=1,size do
  textTable[o] = string.sub(text,o,o)
end
key = "string"
kSize = string.len(key)
for n = 1,kSize do
  keyTable[n] = string.sub(key,n,n)
end
--Encrypt
for i=1,size do
  if i > kSize then
	t = (i % kSize) + 1
  else
	t = i
  end
  textTable[i] = string.byte(textTable[i])
  keyTable[t] = string.byte(keyTable[t])
  textTable[i] = bit.bxor(textTable[i],keyTable[t])
  textTable[i] = string.format("%c",textTable[i])
end
print("Encrypted:")
for z=1,size do
  write(textTable[z])
end
print()
local s = table.getn(textTable)
print("Size of Encrypted:"..s)
print("Size of Original:"..size)
--Decrypt
for i=1,size do
if i > kSize then
  t = (i % kSize) + 1
else
  t = i
end
textTable[i] = string.byte(textTable[i])
textTable[i] = bit.bxor(textTable[i],keyTable[t])
-- textTable[i] = string.format("%c",textTable[i])
textTable[i] = string.char(textTable[i])
end
print("Decrypted:")
for z=1,size do
  write(textTable[z])
end
print()

Quote

pastebin get hQctdisk encrypt



#69897 Index Expected, got Nil.

Posted by Rwkeith on 06 January 2013 - 10:11 AM in Ask a Pro

Fixed my problem right after posting. Apparently the website I was reading on tables made a big mistake when they said you didn't need to declare tables.

All I needed was textTable = {}



#69895 Index Expected, got Nil.

Posted by Rwkeith on 06 January 2013 - 10:09 AM in Ask a Pro

I'm assigning values to an array. However, my for loop doesn't seem to be working right.

for o=1,size do
    textTable[o] = string.sub(text,o,o)
end

I've tested my size variable. That's fine. I've also tried to use string.sub(text,o,o), but that gives me a similar error. However, I can assign it to a variable and print the variable. Any advice would be appreciated.



#68989 KreOS 3.01 Skylark - Old traditions newly defined

Posted by Rwkeith on 04 January 2013 - 09:46 PM in Operating Systems

People seem to not read your bug list =P I love what your doing here and it's actually the first 'OS' I've used for CC. I like the details as well. I'm interested in seeing more detail in the menu's too. I'm sure you've got plans for this already, but I will definitely continue using this.



#29585 Running a program inside a program?

Posted by Rwkeith on 03 September 2012 - 05:47 PM in Ask a Pro

View Postardera, on 03 September 2012 - 05:40 PM, said:

the usage is the following:
shell.run("programname", "param1", "param2", "param3", "param4") --and so on...
Thanks, I figured out my problem.

shell.run("gps","host",10,20,30)



#29580 Running a program inside a program?

Posted by Rwkeith on 03 September 2012 - 05:37 PM in Ask a Pro

Hi, I'm trying to run a program using os.run or shell.run and I have no luck. I'm trying to create a program that will automatically run "gps host x,y,z". But it will only run gps, and not 'gps host'. There's no api for this so im stuck with running it. Can anyone mind telling me what I'm doing wrong?



#29312 Learn to Program! ComputerCraft Workshop- 25th August

Posted by Rwkeith on 02 September 2012 - 02:46 PM in Tutorials

I'm interested, count me into the next class.