Jump to content




Pcutils

utility api

30 replies to this topic

#21 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 22 September 2013 - 08:07 PM

View Postrobotica34, on 22 September 2013 - 12:40 PM, said:

-snip-
Look around the function that like 105 is in. You have a variable named `type`, and its a string, that is overriding the `type` function, so when you do type(side) its trying to "call [a] string"
This could have been answered by reading this topic in Ask a Pro.

#22 robotica34

  • Members
  • 28 posts
  • Locationpcapi.location

Posted 23 September 2013 - 12:57 AM

You are a genius! I would've not figured it out myself :D Thank you!

#23 robotica34

  • Members
  • 28 posts
  • Locationpcapi.location

Posted 23 September 2013 - 11:46 AM

I am rewriting my buttons, and I have a hard time figuring out how to split a string into equal x long parts. How can I do it easily?

#24 bowstones

  • New Members
  • 1 posts

Posted 23 September 2013 - 10:45 PM

have you tried to include another script file using the "require" command? CC doesn't seem to like it.

#25 AgentE382

  • Members
  • 119 posts

Posted 25 September 2013 - 08:31 AM

View Postrobotica34, on 23 September 2013 - 11:46 AM, said:

I am rewriting my buttons, and I have a hard time figuring out how to split a string into equal x long parts. How can I do it easily?

function splitequally(str, sublen)
  local len = #str
  local substrs = {}
  for i = 1, math.ceil(len/sublen) do
    substrs[i] = string.sub(str, (i - 1) * sublen + 1, i * sublen)
  end
  return substrs
end
Alternatively, you can do `return unpack(substrs)`, if you want multiple returns.

#26 AgentE382

  • Members
  • 119 posts

Posted 25 September 2013 - 08:32 AM

View Postbowstones, on 23 September 2013 - 10:45 PM, said:

have you tried to include another script file using the "require" command? CC doesn't seem to like it.

Start your own topic in the "Ask a pro" section.

#27 robotica34

  • Members
  • 28 posts
  • Locationpcapi.location

Posted 26 September 2013 - 02:04 AM

View PostAgentE382, on 25 September 2013 - 08:31 AM, said:

View Postrobotica34, on 23 September 2013 - 11:46 AM, said:

I am rewriting my buttons, and I have a hard time figuring out how to split a string into equal x long parts. How can I do it easily?

function splitequally(str, sublen)
  local len = #str
  local substrs = {}
  for i = 1, math.ceil(len/sublen) do
	substrs[i] = string.sub(str, (i - 1) * sublen + 1, i * sublen)
  end
  return substrs
end
Alternatively, you can do `return unpack(substrs)`, if you want multiple returns.
I'm super sorry, but I've already figured it out. Now to print that text in the middle of a button!

#28 robotica34

  • Members
  • 28 posts
  • Locationpcapi.location

Posted 27 September 2013 - 08:59 AM

The update is running late, but now we have UPDATE v1.2! Check OP for details.

#29 robotica34

  • Members
  • 28 posts
  • Locationpcapi.location

Posted 07 October 2013 - 11:24 AM

Anyone?..

#30 robotica34

  • Members
  • 28 posts
  • Locationpcapi.location

Posted 26 October 2013 - 09:55 AM

Hello people,

You might wonder why I'm not releasing an update for several weeks now. This is because of two reasons - first, I'm working on Minesweeper, and second, I got a bit 'tired' of coding - what I mean by that, I'm struggling to get new information on how to solve different problems. My lack of knowledge really brings me to the end of programming. I might do something for the Utility API (which I'll call PCutils later), but not soon.

Sorry for the bad news.
Sincerely,
robotica34

#31 robotica34

  • Members
  • 28 posts
  • Locationpcapi.location

Posted 20 August 2019 - 08:28 AM

Jesus Christ, talk about digging up some cringe...





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users