Closed i029243 closed 7 years ago
Is the chart control still on the form when in design time? Are you compiling for .net 4.5 or for mono?
Yes,
in the Design screen, the chart is visible , but once compiled, it does not show up. I have .NET 4.5 installed on the machine.
Also, if I build solution for release, the lastBet object reference does not work in programming mode.
I am using VS2013 to compile the project.
Please find additional into .. correction in earlier msg.
When I restarted machine and started visual studio again, I got below error while opening the project.
To prevent possible data loss before loading the designer, the following errors must be resolved:
The type or namespace name 'DataVisualization' does not exist in the namespace 'System.Windows.Forms' (are you missing an assembly reference?)
Make sure the reference to System.Windows.Forms.DataVisualization has been added to your project. It's been removed by your VS for some reason. Sounds almost like your .net installation is faulty. It usually happens when you upgrade from 3.5 to 4.6 directly, some 4.0 and 4.5 components are skipped.
Regarding the lastBet object. did you try to access it before having placed a bet? or after?
Any suggestion how to rectify this ? I am on Windows 10 with VS 2013 Thanks in advance
I fixed the System.Windows.Forms.DataVisualization.dll issue by adding it in the references. so the error is gone, but I still do not get Chart after compiling the binary.
I am using .Net 4.5.2 as Target Framework
I see now that I checked in some changes I was experimenting with for the charts that obviously didn't work.
Clone this commit: https://github.com/Seuntjie900/DiceBot/commit/c7484050a314deac7c0979f43bcbc93ebca33322 This is the code as it was for v3.3.0
I am not much experienced on Git. I just cloned the repository and made changes as per my need . How do I clone this commit without loosing any of my newly added changes. mainly cDiceBot.cs
So, anyway. Finally I just took a hard reset and redone all my changes. here is the new problem I am facing.
Every time starting a script in program mode, below error shows up
Starting Dicebot 3.3.0 Betting Stopped! LUA ERROR!! Index was outside the bounds of the array. start() Betting Stopped! Index was outside the bounds of the array.
Once the script start again, next error is there is no access to lastBet object.
I use lastBet.Profit to calculate total profit, but failing.
Any suggestions ?
An alternative could have been to compare the two commits and see what code regarding the charts have changed and could have broken then. Either way, your stuff is working, so cool.
Sounds like an error in your lua script or the code you added to the bot. Hard to say without seeing any of it.
The thing is, when the script fails with above error ... If I start same script, it works fine. No changes.
Starting Dicebot 3.3.0 Betting Stopped! LUA ERROR!! Index was outside the bounds of the array. start() Betting Stopped! Index was outside the bounds of the array. stop() Betting Stopped! start() Betting 0.000000221 at 28.0984498% chance to win, high Betting 0.000000108 at 42.1893007% chance to win, high Betting 0.00000011 at 33.0085991% chance to win, high Betting 0.0000002398 at 27.5139393% chance to win, high Betting 0.000000484396 at 29.5260121% chance to win, high Betting 0.000000109 at 21.515838% chance to win, high stop() Betting Stopped!
So, it can not be the script problem.
I have not changed any standard variables or anything .. Just created some buttons and added logic to it. Script does not use any of my changes.
How can the lastBet object access can get affected ?? Any suggestions ?
I can check again, but should know what to hunt for.
Still sounds like something in your script. The error message is not indicative that the problem is with the lastBet variable, in fact, quite the opposite. If there was a problem with the lastBet variable, it would have complained about a null (or nil) reference.
Do you have an array in your script? It sounds like your trying to get a value from an array that is not yet populated the first time you run the script, but gets populated later on in the code, which would explain why it runs the second time.
This is my script , I added some print statements to execute the logic https://pastebin.com/raw/4Z5KVJfF
Seems like, it puts the bet and does not execute any code inside dobet() at all, because not a single print statement in the output
I login fresh, go to program mode, Paste the script, in console I run start() , it makes One Bet and this is what I am getting.
Starting Dicebot 3.3.0 Betting Stopped! LUA ERROR!! Index was outside the bounds of the array. start() Betting Stopped! Index was outside the bounds of the array.
I Ran a simulation of your script using v3.3.0 and it ran fine, so it's not something in the script, nor is it something in the bot as it is in the commit that I linked you to (because that is the code that compiled 3.3.0).
Have you tried using a breakpoint to see where the error originates? What are the changes that you've made? Are they being used when you try to start the bot?
Let me spend some time to check the code.
Most logic is standard but may be, I have some function that is called when data on the bet or chance or balance gets changed.
I will try to disable call to my functions and see nothing gets used when I am in programming mode and see.
Thanks for the inputs.
Hello, I compiled the bot source in VS 2013 after correcting Noesis etc issues, but there is no Chart displayed.
Can you suggest a solution to fix this ?