Gamestudio Links
Zorro Links
Newest Posts
Increasing Number Animation
by gamers. 02/19/20 07:16
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
7 registered members (txesmi, 3run, tnktnns, jenGs, gamers, Quad, 1 invisible), 747 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
DebraSteed, Ricard, Apollo1, ziphnor, thomasprv
18377 Registered Users
Active Threads | Active Posts | Unanswered Today | Since Yesterday | This Week
Ask the Developers
3 hours ago
I might sound dumb, but for me, having (f.e.) .fbx files on the desktop doesn't work either. Only placing them directly in C:\ with a folder named with english letters helps. And another thing is, to make sure that loading .fbx files are 2010 not higher.

Best regards.
4 43 Read More
Starting with Gamestudio
3 hours ago
Thank you so much @3run & @txesmi
9 87 Read More
Ask the Developers
3 hours ago
You can check which dependencies are missing with depends.exe: http://www.dependencywalker.com/

Load fbxfiles2010.dll with the tool, it will show you missing dependencies in your system. (Not all missing dependencies are required for it to work though, i mean you will see tons of stuff missing, you can try to figure out what among them should not be missing)
4 43 Read More
Ask the Developers
Yesterday at 23:29
Hm Visual C++ 2010, 2013 and 2015 (x86 and x64) are installed. Still can`t use the plugins.
4 43 Read More
Ask the Developers
Yesterday at 22:24
I vaguely remember it required a version of microsoft visual c++ redistributable package but no sure which one.
Try 2010 installing and 2013
4 43 Read More
Ask the Developers
Yesterday at 21:02
Hello,

On a fresh install of the latest version of Gamestudio A8 on a modern Windows 10 64 Bit machine, MED has problems with the FbxFiles2010.dll, the WmpImporter.dll and the cpi01.dll. The dlls exist and are located in the right folders. The med.log looks like this:

Code
load dll: MS\CPI01.DLL
full name: <C:\Program Files (x86)\GStudio8\MS\CPI01.DLL>
.............

load dll: med_plugins\FbxFiles2010.dll
Can't load library <C:\Program Files (x86)\GStudio8\med_plugins\FbxFiles2010.dll>
System message #14001:
Diese Anwendung konnte nicht gestartet werden, da die Side-by-Side-Konfiguration ungültig ist. Weitere Informationen finden Sie im Anwendungsereignisprotokoll. Weitere Details können auch mit dem Befehlszeilentool sxstrace.exe angezeigt werden.
error loading

------------

load dll: med_plugins\WmpImporter.dll
Can't load library <C:\Program Files (x86)\GStudio8\med_plugins\WmpImporter.dll>
System message #126:
Das angegebene Modul wurde nicht gefunden.
error loading


I need those plugins to import some fbx files. Is there any dependency that has to be installed?
4 43 Read More
Starting with Gamestudio
Yesterday at 17:57
Hi,
I think that when you work with numbers is better to use numerical variables instead of strings.

Here goes a simple implementation with the use of 'key_any' and 'key_lastpressed'

Code
function num_edit (var *_ptr_num, var _max) {
	var _old_value = *_ptr_num;
	var _last_pressed = key_lastpressed;
	while(1) {
		if(key_any) {
			if(key_lastpressed != _last_pressed) {
				_last_pressed = key_lastpressed;
				switch(_last_pressed) {
					case 1: // esc
						*_ptr_num = _old_value;
						return;
					
					case 14: // back space
						*_ptr_num = floor(*_ptr_num / 10);
						break;
					
					case 28: // enter
						return;
					
					default: // any other key
						if(_last_pressed > 11) // from 1 to 0 keys -> from 2 to 11 scancodes
							break;
						var _res = *_ptr_num * 10 + (_last_pressed - 1) % 10; // 11 = scancode of 0 character
						if(_res > _max)
							break;
						*_ptr_num = _res;
				}
			}
		} else {
			_last_pressed = 0;
		}
		wait(1);
	}
}

// --------------------------------------------------

function main () {
	static var my_num = 20;
	num_edit(my_num, 150);
	
	while(1) {
		DEBUG_VAR(my_num, 100);
		wait(1);
	}
}


Salud!
9 87 Read More
Starting with Zorro
Yesterday at 16:59
Ok. I suppose you haven't modified BrokerPatch in z.ini. The next step: Compare a recent trade in the 3 logs, the Zorro log, the MT4 experts log, and the MT4 journal. If you get wrong results, one of the 3 must be wrong - or all 3. Post the relevant sections of the logs here.
8 243 Read More
Starting with Gamestudio
Yesterday at 15:17
I would change 2 to 3 in this part
Code
// we can also check for the range here
// if it's more than 2 characters, then we are out of the range
if(str_len(name_str) > 2)

So we will allow to enter value which is made out of 3 characters.
Then I would convert string into the variable using str_to_num.
And at the end I would check if this variable is higher than 150 or not. If it is, then give error, if it is not then save data.

Best regards!
9 87 Read More
Starting with Gamestudio
Yesterday at 15:05
Originally Posted by 3run
You are welcome! Glad to be helpful.


Thank you again, @3run. I just want to ask because I'm curious about. If the user provided a condition between 0 and 150 (instead of 0 to 100 value), how could we do that?
9 87 Read More
Starting with Gamestudio
Yesterday at 12:51
You are welcome! Glad to be helpful.
9 87 Read More
Starting with Gamestudio
Yesterday at 12:12
Originally Posted by 3run
Well, you needed to use stuff I've made in this thread.

Try this code:
Code
BMAP *pointer_tga = "pointer.png";

STRING *name_str = "Click to Enter Value Here!";
STRING *enter_value_str = "Click to Enter Value Here!";
STRING *error_msg_str = "You need to enter a number from 0 to 99!";
STRING *data_saved_msg_str = "Data was successfully saved into the log file.";

function input_name(); 

PANEL *input_pan = 
{
	layer = 10;
	bmap = "textbox.png";
	on_click = input_name;
	flags = SHOW;
}

TEXT *name_txt = 
{
	layer = 11; // just above the textbox panel
	font = "Calibri#30";   
	string(name_str);
	flags = SHOW | CENTER_X | CENTER_Y;
}

// receives a STRING and position (num) of a character in that STRING
// returns a single character as a STRING
STRING *get_next_char(STRING *src_str, int num)
{
	if(!src_str)
	{
		return NULL;
	}
	
	if(num > str_len(src_str))
	{
		return NULL;
	}
	
	STRING *temp_str = "";
	str_cpy(temp_str, src_str);
	str_trunc(temp_str, str_len(src_str) - num);
	str_clip(temp_str, num - 1);
	
	return temp_str;
}

// returns TRUE (1) if string is numeric
// otherwise returs FALSE (0)
var is_numeric_str(STRING *src_str)
{
	if(!src_str)
	{
		return false;
	}
	
	int i = 0, j = 0, res = true;
	
	for (i = 0; i < str_len(src_str); i++)
	{
		STRING *temp_str = get_next_char(src_str, i + 1);
		
		for (j = 0; j < 10; j++)
		{
			if (!str_cmpi(temp_str, str_for_num(NULL, j)))
			{
				res = false;
				continue;
			}
			
			res = true;
			break;
		}
		
		if(res == false)
		{
			break;
		}
	}
	
	return res;
}

// returns TRUE (1) is string's length is zero
// otherwise returns FALSE (0)
var is_empty_str(STRING *str)
{
	if(!str)
	{
		return false;
	}
	
	if(str_len(str) > 0)
	{
		return false;
	}
	else
	{
		return true;
	}
}

function input_name()
{
	str_cpy(name_str, "   ");
	var input = inkey(name_str);
	
	if(input != 13) // terminated input with ESC or anything else ?
	{
		// then return "Click to Enter Value Here!" message back
		// same for all errors bellow !
		str_cpy(name_str, enter_value_str);
	}
	else // pressed enter ?
	{
		// string is empty ? then show error message
		if(is_empty_str(name_str))
		{
			error(error_msg_str);
			str_cpy(name_str, enter_value_str);
		}
		else // if not ?
		{
			// if numeric ? then save the file
			if(is_numeric_str(name_str))
			{
				// we can also check for the range here
				// if it's more than 2 characters, then we are out of the range
				if(str_len(name_str) > 2)
				{
					error(error_msg_str);
					str_cpy(name_str, enter_value_str);
				}
				else // 0 ... 99
				{
					var filehandle;
					filehandle = file_open_write("log.xml"); 
					file_str_write(filehandle, name_str); 
					file_close(filehandle);
					error(data_saved_msg_str);
				}
			}
			else // not numeric ? then show error message
			{
				error(error_msg_str);
				str_cpy(name_str, enter_value_str);
			}
		}
	}
}

function mouse_startup()
{
	warn_level = 6; // make sure to show all errors
	fps_max = 60; // limit fps to 60
	
	mouse_mode = 4; // this will take care of mouse_cursor/mouse_pos stuff
	mouse_map = pointer_tga;
	
	while(!key_esc)
	{
		// we need to do this in order to have proper panel positions with different screen resolutions
		input_pan->pos_x = (screen_size.x / 2) - (bmap_width(input_pan->bmap) / 2);
		input_pan->pos_y = (screen_size.y / 2) - (bmap_height(input_pan->bmap) / 2) - 64;
		
		name_txt->pos_x = input_pan->pos_x + (bmap_width(input_pan->bmap) / 2);
		name_txt->pos_y = input_pan->pos_y + (bmap_height(input_pan->bmap) / 2);
		
		wait(1);
	}
}


Greets!


Thank you @3run laugh That was great solution! This is exactly what I want to do.
9 87 Read More
Starting with Gamestudio
Yesterday at 10:03
Well, you needed to use stuff I've made in this thread.

Try this code:
Code
BMAP *pointer_tga = "pointer.png";

STRING *name_str = "Click to Enter Value Here!";
STRING *enter_value_str = "Click to Enter Value Here!";
STRING *error_msg_str = "You need to enter a number from 0 to 99!";
STRING *data_saved_msg_str = "Data was successfully saved into the log file.";

function input_name(); 

PANEL *input_pan = 
{
	layer = 10;
	bmap = "textbox.png";
	on_click = input_name;
	flags = SHOW;
}

TEXT *name_txt = 
{
	layer = 11; // just above the textbox panel
	font = "Calibri#30";   
	string(name_str);
	flags = SHOW | CENTER_X | CENTER_Y;
}

// receives a STRING and position (num) of a character in that STRING
// returns a single character as a STRING
STRING *get_next_char(STRING *src_str, int num)
{
	if(!src_str)
	{
		return NULL;
	}
	
	if(num > str_len(src_str))
	{
		return NULL;
	}
	
	STRING *temp_str = "";
	str_cpy(temp_str, src_str);
	str_trunc(temp_str, str_len(src_str) - num);
	str_clip(temp_str, num - 1);
	
	return temp_str;
}

// returns TRUE (1) if string is numeric
// otherwise returs FALSE (0)
var is_numeric_str(STRING *src_str)
{
	if(!src_str)
	{
		return false;
	}
	
	int i = 0, j = 0, res = true;
	
	for (i = 0; i < str_len(src_str); i++)
	{
		STRING *temp_str = get_next_char(src_str, i + 1);
		
		for (j = 0; j < 10; j++)
		{
			if (!str_cmpi(temp_str, str_for_num(NULL, j)))
			{
				res = false;
				continue;
			}
			
			res = true;
			break;
		}
		
		if(res == false)
		{
			break;
		}
	}
	
	return res;
}

// returns TRUE (1) is string's length is zero
// otherwise returns FALSE (0)
var is_empty_str(STRING *str)
{
	if(!str)
	{
		return false;
	}
	
	if(str_len(str) > 0)
	{
		return false;
	}
	else
	{
		return true;
	}
}

function input_name()
{
	str_cpy(name_str, "   ");
	var input = inkey(name_str);
	
	if(input != 13) // terminated input with ESC or anything else ?
	{
		// then return "Click to Enter Value Here!" message back
		// same for all errors bellow !
		str_cpy(name_str, enter_value_str);
	}
	else // pressed enter ?
	{
		// string is empty ? then show error message
		if(is_empty_str(name_str))
		{
			error(error_msg_str);
			str_cpy(name_str, enter_value_str);
		}
		else // if not ?
		{
			// if numeric ? then save the file
			if(is_numeric_str(name_str))
			{
				// we can also check for the range here
				// if it's more than 2 characters, then we are out of the range
				if(str_len(name_str) > 2)
				{
					error(error_msg_str);
					str_cpy(name_str, enter_value_str);
				}
				else // 0 ... 99
				{
					var filehandle;
					filehandle = file_open_write("log.xml"); 
					file_str_write(filehandle, name_str); 
					file_close(filehandle);
					error(data_saved_msg_str);
				}
			}
			else // not numeric ? then show error message
			{
				error(error_msg_str);
				str_cpy(name_str, enter_value_str);
			}
		}
	}
}

function mouse_startup()
{
	warn_level = 6; // make sure to show all errors
	fps_max = 60; // limit fps to 60
	
	mouse_mode = 4; // this will take care of mouse_cursor/mouse_pos stuff
	mouse_map = pointer_tga;
	
	while(!key_esc)
	{
		// we need to do this in order to have proper panel positions with different screen resolutions
		input_pan->pos_x = (screen_size.x / 2) - (bmap_width(input_pan->bmap) / 2);
		input_pan->pos_y = (screen_size.y / 2) - (bmap_height(input_pan->bmap) / 2) - 64;
		
		name_txt->pos_x = input_pan->pos_x + (bmap_width(input_pan->bmap) / 2);
		name_txt->pos_y = input_pan->pos_y + (bmap_height(input_pan->bmap) / 2);
		
		wait(1);
	}
}


Greets!
9 87 Read More
Starting with Zorro
Yesterday at 09:36
Yes, via Mt4
8 243 Read More
Starting with Gamestudio
Yesterday at 09:35
Originally Posted by 3run
Hey,

So basically you only need to save input from user in range of 0...99 into the file, and everything different from that shouldn't be saved + user should be warned that entered data is incorrect?

Greets


That's true,
If I can check the data entered in the textbox, it can already save sample code, but I was not able to integrate the data control in to the sample code.

Best regards,
9 87 Read More
Starting with Gamestudio
Yesterday at 08:20
Hey,

So basically you only need to save input from user in range of 0...99 into the file, and everything different from that shouldn't be saved + user should be warned that entered data is incorrect?

Greets
9 87 Read More
Starting with Gamestudio
Yesterday at 08:05
Hi there,
I need some help, again.
How to save the result to the log file in desired conditions by checking the data entered in the textbox?

For example, how can I ensure that the data is saved in the log file only when a value between 0 and 100 is entered in the text box, and that the user is warned when any data is entered or a character is written outside of mentioned values?

In the example below, I was able to save the data entered in textbox, but I could not check the data type.
I'll be happy if you can help me.
Yours truly,

Here is the example: https://we.tl/t-uS1ItW0oRb
9 87 Read More
Zorro Scripts
Yesterday at 02:39
Is there any existing function or mode where I can set the `enterLong()` and `enterShort()` as normal buy and sell for Binance? just like how Z10 rebalancing.
My current scripts are using default so when I enterLong on binance it shows the PnL on control panel which I don't want to.
0 21 Read More
Morbius' Virtual Answering Machine
02/19/20 19:23
Ok, das ist dann ja echt zu vernachlässigen...
243 268,513 Read More
Starting with Gamestudio
02/19/20 15:25
Fantastic! Thank you so much 3run.
2 50 Read More
Starting with Gamestudio
02/19/20 14:54
You can use needle for that.

Here is an example:
[Linked Image]

Code:
Code
#include <acknex.h>
#include <default.c>

#define PRAGMA_POINTER

FONT *main_text_font = "Courier#64";

var credibility = 50;

BMAP *needle_png = "needle.png";
BMAP *range_png = "range.png";

PANEL *needle_pan = 
{
	scale_x = 4;
	scale_y = 4;
	digits(0, -48, "CREDIBILITY", main_text_font, 0, 0);
	needle(0, 0, needle_png, 30, 1, 0, 200, 0, credibility);
	flags = SHOW | CENTER_X | CENTER_Y;
}

PANEL *range_pan = 
{
	scale_x = 6;
	scale_y = 6;
	bmap = range_png;
	flags = SHOW;
}

void main()
{
	warn_level = 6;
	fps_max = 60;
	
	pan_setcolor(needle_pan, 1, 1, COLOR_GREY);
	
	while(!key_esc)
	{
		needle_pan->pos_x = screen_size.x / 2;
		needle_pan->pos_y = (screen_size.y / 2) + 96;
		
		range_pan->pos_x = needle_pan->pos_x - ((bmap_width(range_pan->bmap) * range_pan->scale_x)  / 2);
		range_pan->pos_y = needle_pan->pos_y - ((bmap_width(range_pan->bmap) * range_pan->scale_y)  / 2);
		
		DEBUG_VAR(credibility, 0);
		credibility -= 5 * (key_a - key_d) * time_step;
		credibility = clamp(credibility, 0, 100);
		wait(1);
	}
}


Images used:
[Linked Image]

[Linked Image]

Best regards!
2 50 Read More
Zorro Future
02/19/20 14:30
Thank you
3 81 Read More
Zorro Future
02/19/20 14:28
On our list.
3 81 Read More
Zorro Future
02/19/20 14:27
bump
3 81 Read More
Starting with Gamestudio
02/19/20 14:03
Hello,
How can I make the indicator (needle) that has a value of 50 at the beginning, and ranges between 0 and 100 according to user ratings in the video?

The video example link is here: https://we.tl/t-z3DX5YiCTB

Thank you,
2 50 Read More
Page 1 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1