Jump to content

Black magic?


Nbacon

Recommended Posts

So I'm working a import system for my project and I ran in to the weirdest bug ever? 

Explation of the bug:

When importing "tool-item" it needs a funtion "item" to run so my pogram reads the file and runs the code in the file. It happens when that code runs it goes and import more code.  (no other  import does this bug and there are like 50+ files with imports inside imports and they work fine) . Seen in the video below I run it with import tool on top of define tool-item it does not work. But when I swap them they work perfectly fine.  Does java have a max number of files open? there are no IOExceptions and all imports that need imports them self work fine. when ran in the termal it works fine. Im at a loss for words and give up unless any of you have any ideas. I have the code that is backing this funtion below.

 

 

 

The java code backing this.

 

  private void fileShit(File readfile) {
        try {
            scemeBot.log("Added " + readfile.getName());

            BufferedReader br = null;
            br = new BufferedReader(new FileReader(readfile));
            StringBuilder stringBuilder =new StringBuilder();
            String st;

            while ((st = br.readLine()) != null) {
                stringBuilder.append(st);
            }
      
            scemeBot.getScheme().eval(stringBuilder.toString());

        } catch (IOException e) {
            scemeBot.log(e);
            e.printStackTrace();
        }
    }

 

 

 

Link to comment
Share on other sites

12 hours ago, Medusa said:

nvm. Sorry I had to bash on your project :(

I saw the ornginal post and I dont think that came off as bashing. Criticism and questions if not malicious should alway be welcome to help everyone understand the goals or misunderstanding.  

To anwser the orginal question something along the lines  "why not just write in java and use the api?"  .

Because once this not fun, a job, or uninteresting Ill just give up. This project has 100 of goals big and small. I can write java code well (if I understand it case in point this post.) but when puting limitations on myself makes things intresting (think ironman). I believe that programing is problem solving and the expression of ideas.  The fun part of programing for me is problem solving and the Laungauge is an extension problem solving.   In the case of osbot it is limited to java and If i can write a more expressive Laungauge within the limitions of java (I should).  I oringaly wrote this program to take assembly like code but oh god is that shit unreadable.  The new Laungauge  implements 99% of the osbot api and can do anyhting java can do plus more and the expensive of compution. 

 

Link to comment
Share on other sites

14 hours ago, Nbacon said:

I saw the ornginal post and I dont think that came off as bashing. Criticism and questions if not malicious should alway be welcome to help everyone understand the goals or misunderstanding.  

To anwser the orginal question something along the lines  "why not just write in java and use the api?"  .

Because once this not fun, a job, or uninteresting Ill just give up. This project has 100 of goals big and small. I can write java code well (if I understand it case in point this post.) but when puting limitations on myself makes things intresting (think ironman). I believe that programing is problem solving and the expression of ideas.  The fun part of programing for me is problem solving and the Laungauge is an extension problem solving.   In the case of osbot it is limited to java and If i can write a more expressive Laungauge within the limitions of java (I should).  I oringaly wrote this program to take assembly like code but oh god is that shit unreadable.  The new Laungauge  implements 99% of the osbot api and can do anyhting java can do plus more and the expensive of compution. 

 

ye I mean if it's a project then I'm cool with it. I thought you wrote it cuz you thought it'd be easier than using the api :) Goodluck bro

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...