Jump to content


VaNnOrus's Content

There have been 12 items by VaNnOrus (Search limited from 29-March 23)


By content type

See this member's

Sort by                Order  

#154569 Read() and limit length of the input field

Posted by VaNnOrus on 30 November 2013 - 02:33 AM in Ask a Pro

View Posttheoriginalbit, on 26 November 2013 - 10:05 PM, said:

If you are feeling exceptionally lazy I do have a working implementation. Its a rewrite I performed of the default `read` but more efficient, and more capabilities, best of all without breaking default usages. You can find more information about it in my programs thread under code snippets.
It's interesting, I use some things in my function, thanx :)

-- UPD
that's what I did, but have not yet written walking the cursor line by line

Attached Image: 11.png



#154199 Read() and limit length of the input field

Posted by VaNnOrus on 26 November 2013 - 08:56 PM in Ask a Pro

View Postwojbie, on 26 November 2013 - 09:33 AM, said:

Not in standard read() function. You can however write your own version of read function that does exactly what you need. If you take a look into bios.lua file you can find definition of standard read that you can edit if you don't want to write it from scratch.
Oh, thanx, I try rewrite this function :)
I will write here when I'll get the desired result :3



#154122 Read() and limit length of the input field

Posted by VaNnOrus on 26 November 2013 - 09:30 AM in Ask a Pro

Is there any way to limit the length of the input field or automatically transfer cursor to the next line when approaching the edge of the screen in the function "read()"?



#154119 Arithmetic Error

Posted by VaNnOrus on 26 November 2013 - 09:07 AM in Ask a Pro

View PostCraftplorer, on 26 November 2013 - 04:26 AM, said:

I also found the error i forgot to rename x,y,z to nx,ny,nz. So a very stupit error.
It often happens it's not scary. Need to be more attentive :)



#154101 Arithmetic Error

Posted by VaNnOrus on 26 November 2013 - 12:20 AM in Ask a Pro

View PostCraftplorer, on 25 November 2013 - 11:29 AM, said:

Im new to Lua and dont really understand how the variable handel...
Why not just read the manual, if you do not know the language?



#154099 RPG Dev. Problems! (elseif, arithmetic, function, etc)

Posted by VaNnOrus on 25 November 2013 - 11:51 PM in Ask a Pro

View PostStrite9000, on 25 November 2013 - 06:09 PM, said:

EDIT: Now I'm also getting the error: battle:302: attempt to perform arithmetic __sub on number and nil, any ideas why?
Here's the updated code: pastebin.com/HTsWZNN6

local BuckleyH = BuckleyH - firstFinalAttack

You are trying to take away some value from non-existent variable
You must declare a variable before operations with it, like that
local a = 2
a = a - 1 -- now a = 1



#154097 VM Error

Posted by VaNnOrus on 25 November 2013 - 11:30 PM in Ask a Pro

View Postnateracecar5, on 25 November 2013 - 07:41 PM, said:

  if not fs.exists("/.flag") then
	    flag = fs.open("/.flag","w")
	    flag.close()
  end
  flag = fs.open("/.flag","w")
  flag.writeLine(nameread)
  flag.close()
Why do you doing the same thing twice? fs.open with "w" will create new file if it don't exists



#154095 help with error in coding

Posted by VaNnOrus on 25 November 2013 - 10:33 PM in Ask a Pro

View Postnaturedpk, on 25 November 2013 - 09:22 PM, said:

my coding with the 70th line some how messed up
And how do you think we need to understand what error line? -_-

I tested the code without any changes - no errors issues
Show that it's on 70th line in your file



#154012 A Few Questions

Posted by VaNnOrus on 25 November 2013 - 09:46 AM in Ask a Pro

 Lyqyd, on 24 November 2013 - 08:29 PM, said:

We have removed topic creation rights for the New Members group, which is why you couldn't start a new topic in Suggestions.

Extended character set support for ComputerCraft is something that has been suggested many times, and is something that I think the developers would like to happen eventually, but last I had heard, there are one or two technical obstacles to it actually happening, and I can't remember what they are.
Very sad...
Maybe if the developer will tell what the technical obstacles are community help to solve them?



#153973 A Few Questions

Posted by VaNnOrus on 24 November 2013 - 07:59 PM in Ask a Pro

 Lyqyd, on 24 November 2013 - 07:41 PM, said:

Pcall is pretty easy to use, the first argument is the function to call, the remaining arguments are the arguments to pass it. For instance, you could call textutils.serialize:

pcall(textutils.serialize, {"a", "table"})

Oh, thanx, I try
pcall(apiname.func)


 Lyqyd, on 24 November 2013 - 07:41 PM, said:

MKLegoman was linking you to the Forum Guidelines post because you obviously haven't read it, or you'd understand that people in the New Members group aren't allowed to start topics (with the recently made exceptions of Bugs and Ask a Pro sections).

But then where I general could ask for help? Sorry, I did not really read the rules. It is somewhat difficult for me, my knowledge of English is not high, but I understand that this is not an excuse. Why do not you just remove rights on start topic for group of new users?

 Lyqyd, on 24 November 2013 - 07:41 PM, said:

Encryption functions are highly unlikely to ever be added to ComputerCraft itself. There's not really any need for them, so if you feel like you need it, you'll have to add/write your own libraries.

Okay :(

Most importantly suggestion was:

 VaNnOrus, on 24 November 2013 - 03:46 AM, said:

I want to suggest to add cyrillic support, it would be awesome :) Для русских-то абсолютно точно :3

what about it?



#153971 A Few Questions

Posted by VaNnOrus on 24 November 2013 - 07:36 PM in Ask a Pro

 MKlegoman357, on 24 November 2013 - 07:28 AM, said:

1 - Calling functions from APIs is very simple:

os.loadAPI("myapi") --// Load your custom API

myapi.myFunction() --// Call a function in that API
Read my question!
I ask how call apis function with pcall or something like pcall. I need safe call which no throws error if function return error. Or tell me if this is not possible.

 MKlegoman357, on 24 November 2013 - 07:28 AM, said:


I tell about support cyrillic encode in the mod. About post - I think that one line in Russian in the post does not violate the rules of the forum. This is a small easter egg for the Russian. If you are against - I can delete this row

 MKlegoman357, on 24 November 2013 - 07:28 AM, said:

3 - Some of them are already made as APIs by community and I'm pretty sure that other encryptions could be made too. Also, Immibi's peripherals have a cryptographic accelerator which can encrypt strings.

No one disputes that there is an encryption functions, but I said that would be good to add them to the standard methods of the CraftOS

 MKlegoman357, on 24 November 2013 - 07:28 AM, said:

4 - Sorry, I don't understand what are you talking about.

Script that compiles luac.exe in "lua for windows"



#153857 A Few Questions

Posted by VaNnOrus on 24 November 2013 - 03:46 AM in Ask a Pro

How can I use pcall or something like it when need run the functions from loaded apis files? That is something like
pcall (file.object: func ())

I can't create new topic in Suggestions :(
I want to suggest to add cyrillic support, it would be awesome :) Для русских-то абсолютно точно :3
Add standard encryption methods (like sha1, md5, etc.)
And add support for the compilation scripts, can sometimes be very useful

Sorry if my english too bad.