View previous topic :: View next topic |
Author |
Message |
nwongfeiying Grandmaster Cheater Reputation: 2
Joined: 25 Jun 2007 Posts: 695
|
Posted: Sun Dec 05, 2010 11:31 pm Post subject: Console Overtype |
|
|
Is it possible to have overtype in a Windows console?
Example:
To
Changing the 0 to a 100%.
|
|
Back to top |
|
|
hcavolsdsadgadsg I'm a spammer Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sun Dec 05, 2010 11:39 pm Post subject: |
|
|
it's possible but there is no real nice way to do it afaik
you can either use system("cls")
use a shitload of newlines
or i guess you could handle all the drawing yourself, but this is overkill.
|
|
Back to top |
|
|
nwongfeiying Grandmaster Cheater Reputation: 2
Joined: 25 Jun 2007 Posts: 695
|
Posted: Sun Dec 05, 2010 11:42 pm Post subject: |
|
|
slovach wrote: | it's possible but there is no real nice way to do it afaik
you can either use system("cls")
use a shitload of newlines
or i guess you could handle all the drawing yourself, but this is overkill. |
Oh Lord. That doesn't sound fun at all. Linux is just special, huh? I'll probably just end up clearing the console screen and rewriting it for a faux overtype.
|
|
Back to top |
|
|
hcavolsdsadgadsg I'm a spammer Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sun Dec 05, 2010 11:48 pm Post subject: |
|
|
why not just create a regular window? it doesn't have to be fancy.
|
|
Back to top |
|
|
nwongfeiying Grandmaster Cheater Reputation: 2
Joined: 25 Jun 2007 Posts: 695
|
Posted: Sun Dec 05, 2010 11:56 pm Post subject: |
|
|
slovach wrote: | why not just create a regular window? it doesn't have to be fancy. |
But consoles are so much cooler! Haha, I guess I'm crazy for the console appearance.
|
|
Back to top |
|
|
Jani Grandmaster Cheater Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
|
Back to top |
|
|
Noz3001 I'm a spammer Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Mon Dec 06, 2010 6:20 am Post subject: |
|
|
you could print out a bunch of '\b' characters
|
|
Back to top |
|
|
AtheistCrusader Grandmaster Cheater Reputation: 6
Joined: 23 Sep 2006 Posts: 681
|
Posted: Mon Dec 06, 2010 8:26 am Post subject: |
|
|
Print "Loading... " + %
Write " " ~5 spaces after last .
Write the % again
REPEAT!
|
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8517 Location: 127.0.0.1
|
Posted: Mon Dec 06, 2010 10:41 am Post subject: |
|
|
Jani gave the best method of doing it, spamming new lines and making it seem like it happened just creates a bigger memory footprint on the application and in the end makes it extremely inefficient.
_________________
- Retired. |
|
Back to top |
|
|
hcavolsdsadgadsg I'm a spammer Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Mon Dec 06, 2010 1:07 pm Post subject: |
|
|
Wiccaan wrote: | Jani gave the best method of doing it, spamming new lines and making it seem like it happened just creates a bigger memory footprint on the application and in the end makes it extremely inefficient. |
i think if you're going for portability though, it might be the most portable way nevertheless :\
gross
|
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8517 Location: 127.0.0.1
|
Posted: Mon Dec 06, 2010 3:24 pm Post subject: |
|
|
slovach wrote: | Wiccaan wrote: | Jani gave the best method of doing it, spamming new lines and making it seem like it happened just creates a bigger memory footprint on the application and in the end makes it extremely inefficient. |
i think if you're going for portability though, it might be the most portable way nevertheless :\
gross |
Using \b for portability would be the better choice then to delete the chars. Granted you'll probably land up getting ugly flickering depending on how often its being updated.
_________________
- Retired. |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Tue Dec 07, 2010 9:27 am Post subject: |
|
|
Also, if the console you are using supports the escape character sequence (e.g ansi) you could use "printf("\033[1;1H");" to set the cursor position to 1,1
This tends to work fine in 'most' linux and mac systems(depending in what state you're running) but for windows you may have to do some extra configuring to let the default console support ansi
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
|