Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Program Announcements / DBP_NETLIB - Plugin for Dark Basic Pro - Official Thread

Author
Message
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 23rd Jun 2004 04:27
thanks
A few people are finding the Variable Watcher quite nifty ATM.

post any questions or comments in this thread
Thanks


* DBP_NETLIB_v1.4 - w/VARIABLE WATCHER & CONSOLE! * Click Logo
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 24th Jun 2004 17:18
Exeat
Re: Clipboard functions

Well all of the functions were working as expected in the vb.net dll and when called from the test vb.net app. The problems you noted werent occurring here in testing so it seems its a dbp thing. In that case there isn't much we can do so I think we should remove them.

new items I will be sending:
-Clipboard Functions removed
-gen_SaveFileDialog
-rename gen_FileDialog to gen_OpenFileDialog
-fil_DeleteFile (good for starting with a new clean file for use with fil_AppendFile. If the file exists its deleted, if not nothing happens)

anything else you want me to add?

CR


* DBP_NETLIB_v1.4 - w/VARIABLE WATCHER & CONSOLE! * Click Logo
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 24th Jun 2004 17:33
Any chance of getting an interface to LUA (cocurrent running of scripts could be handy)...


The place for great plug-ins and things.
There's the right way, the wrong way and the TCA way...
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 24th Jun 2004 20:13
heh


* DBP_NETLIB_v1.4 - w/VARIABLE WATCHER & CONSOLE! * Click Logo
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 25th Jun 2004 04:02
Quote: "anything else you want me to add?"


Not that I can think of, it's a shame the clipboard commands aren't working properly. Not sure if we can do anything about it though. Oh well.


Quote: "Any chance of getting an interface to LUA (cocurrent running of scripts could be handy)..."


I've never heard of LUA, care to explain what it is?


"Computers are useless they can only give you answers."
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 25th Jun 2004 04:46
It something that TCA was asking about in the irc room, that I kept bringing up as if I knew what it was - which I don't - which TCA figured out. I think his post was just some friendly ball busting.

Heh.


* DBP_NETLIB_v1.4 - w/VARIABLE WATCHER & CONSOLE! * Click Logo
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 25th Jun 2004 07:53
Ahh, I see.


"Computers are useless they can only give you answers."
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 30th Jun 2004 05:35 Edited at: 30th Jun 2004 05:48
New Version Released – DBP_NETLIB_v1.4.3.zip July, 2004

Full Function Listing:


Modifications:
* gen_FileDialog() was renamed to gen_OpenFileDialgog(), args remain the same
* fil_GetFileToString(filename) which previously returned a line-break delimited string now returns a comma-delimited string with the extra trailing comma truncated (eg. “data1,data2,data3”)

Additions:
* gen_SaveFileDialog(InitialDir, Filter) – provides a standard windows save file dialog which allows a file name to be selected or typed into the text field. The full path and file name are returned as a string.
* fil_DeleteFile(filename) – deletes the specified file
* gen_GetProcessList() – returns the system process list as a comma-delimited string.

* fil_LoadFile(filename) – parses the specified file into a string array which is persisted in the dll. Each line of file becomes an individual element of the persisted array. Successive calls to this function completely flush and reload the data stored in the array. This function returns an Integer which indicates the Upper-Bound index in the array and is zero based - A return value of negative one (-1) indicates an error has occurred. Use this function with the following three functions…

* fil_GetLineAsStr(index)
* fil_GetLineAsInt(index)
* fil_GetLineAsFlt(index)

Each of the above functions returns the data from the specified Index of the Array created by the most recent call to fil_LoadFile(). You can return All, some, or individual pieces of data as strings, integers, or floats – with all type conversion handled in the dll.

Other Notes:
* The file reading functions above all contain error handlers and error logging, see the docs for details.
* fil_LoadFile() can be used in conjunction with DIM to help determine the correct size an array should be defined to, for later use with other DBP functions like LOAD ARRAY(). It is no longer necessary to know the length of a file ahead of time, that you intend to load into a dbp array.

DBP CODE Example:
DIM myArray(fil_LoadFile(filename)) as String
LOAD ARRAY “myfile.txt”, myArray(0)


All questions and comments welcome
Obtain the plugin by clicking the logo below

Thanks,
CattleRustler & Exeat


* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 30th Jun 2004 12:56
And the console no longer steals focus also.


"Computers are useless they can only give you answers."
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 30th Jun 2004 13:07
oh yeah...

sorry, forgot about that


* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 3rd Jul 2004 05:16 Edited at: 3rd Jul 2004 05:17
In Response to MasterInsane's email:
(I tried to reply but it was rejected for some reason)

MasterInsane Wrote:
Quote: "I really like the idea of using your DBPro plugin, as it seems far superior to many plugins. However, I am not a very large fan of Microsoft's .NET idea, and I'm even less of a fan of their .NET framework. I really would love to use your plugin, though. Is there any chance you might be converting it to another language sometime in the future? If not, I suppose I'll deal with it and use your plug-in still, heheh, but it would really please me if I didn't have to make every user of my program download the .NET framework.

Thanks for the awesome plugin, either way."


My reply:
Quote: "Thanks for the kind words. The whole point was that I code in vb/vb.net and I wanted to use .net to make a plugin for dbp. I understand your concerns about end users needing the .net framework – the thought process for me is that although right now it’s a needed download, everything is moving towards .net. MS next OS is pure .net and XP already ships with 1.0 of the framework. XP sp2 contains 1.1 Framework if I am not mistaken. So many people may already have the 1.1 framework and not even know it. As time goes by everyone using windows will be running the necessary prerequisites. Hopefully for now its not too much of a headache to download the framework. I hope you decide to use our plugin

If you have any questions regarding the plugin feel free to email or ask in our thread in the Program Announcements forum

Thanks
CR"



* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 11th Jul 2004 02:13
Well that sucks about the screenshot stuff not working but everything else seems OK

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 11th Jul 2004 04:09
Thanks, have you tried the
fil_LoadFile(filename)
fil_GetLineAsStr(index)
fil_GetLineAsInt(index)
fil_GetLineAsFlt(index)

functions yet?
(see a few posts up Posted: 29th Jun 2004 15:35)

all feedback welcome


* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 11th Jul 2004 12:56 Edited at: 11th Jul 2004 13:49
OMG no I missed them somehow. I will test now
[edit] Also While checking these commands out. I have a question regarding the screenshot attempt. Can you make a function to take the image in the clipboard and make a .bmp from it? Don't worry about trying to get the image to the clipboard. If I get it in there could you do it?

[edit2] Tried those 4 functions and they work great.
[edited again because I had a typo in my prog ] All is well.
Also It seems that while DBP is running you cannot copy anything to the clipboard like copy/paste in text. Though print screen still works. That may have been causing some of your problems. So if I bound the printscreen button to call your function to convert the clipboard image to a file it would copy the image to the clipboard and then through your function to a file preferrably .bmp.

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 11th Jul 2004 14:33 Edited at: 11th Jul 2004 14:40
Thanks and I hope you find those functions useful

regarding clipboard stuff, yes we can take whats on the clipboard and stream it into a bmp file, and I am intersted in what you were saying about the keys and what the possible dbp problem is/was. Maybe Exeat can jump into this conversation as well because when he stated that there were problems with our functions with respect to the clipboard/bmps etc, I didnt investigate it too much further but he had som better insight at the time - I was more in the frame of mind of "f*ck it". Maybe we 3 could work out the issues and reinstate those functions?

<hopes he didn't delete the code>

edit: nope, still there - just remmed

Also, maybe we could discuss what would be nice as far as multiple joysticks - I know there is an issue with multi joysticks of same name because dbp only enumerates () by NAME and not other DX ids. I have successfully enumerated joysticks via GUID on DX Layer but am not sure how to proceed. I am assuming we would need to make new versions of all of the DBP joystick commands but allow guid references as opposed to just names. Any help in this matter would be welcome so maybe I could get this new functionality off the ground - just a thought, since we are brainstorming


* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 11th Jul 2004 14:40
Just give me a function to make the image in the clipboard into a file and I'll figure out a way to get the image there and test it.

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 11th Jul 2004 14:45 Edited at: 11th Jul 2004 14:46
ok

(note: we simul-posted so see above for my edits)


* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 11th Jul 2004 16:57
I don't know what's wrong with the clipboard commands, DBP might create it's own temp clipboard or something, who knows. o_O I guess I could take a longer look later on.


"Computers are useless they can only give you answers."
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 11th Jul 2004 17:37
I know DBP takes over the ability to copy to the clipboard from other programs. Run any DBP program and alt tab out with it minumized. Open a text document type something in and select it and use copy. Then try to paste it and it won't let you. You will have to close your DBP program and then copy paste. Its like DBP is keeping you from copying to the clipboard. But copy something to the clipboard using print screen and it seems to bypass this as you can hit print screen and paste the image into mspaint while your DBP program is running.

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 11th Jul 2004 18:06
....interesting....


* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 12th Jul 2004 03:38
@ LIT

Ok, I reinstated the clp_SaveImage() function in the dll, which I will send off to Exeat to be wrapped - please let me know if and when you have your part working (ie-you can send valid image data to the windows clipboard programmatically) Once you have this working, post here and I will send to Exeat. I don't want to send him unecessary work if the other part is not working.

Thanks
CR


* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 12th Jul 2004 03:54
Using print screen already does this. Run your DBP program and hit print screen. Alt tab out open mspaint (while dbp program is still running) and select paste. It will copy the screen shot to mspaint. So If I use the printscreen button with your function (may have to add a small wait between the 2) It should work. Theoretically of course.

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 12th Jul 2004 04:44
but are you doing the print screen automatically or actually pressing the key?


* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 12th Jul 2004 05:17
pressing the key. I figure you will have to put a slight delay between pressing the key and using your function.

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 12th Jul 2004 06:13
So wait, are you saying that the program will watch for printscreen keypress, and then do a slight delay, then call the function that writes the image data to a file?

if so then "Ah, I get it now"


* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 12th Jul 2004 06:19
yes thats what I want to do

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 12th Jul 2004 06:38 Edited at: 12th Jul 2004 06:43
ok, I did a test...

I hijacked one of the other function's names and substitued its code for the code in the clp_SaveImage Routine (so I could test here without Exeat having to wrap) And the function works nicely...If there is image data on the clipboard via the print-screen key the image is written to a bmp file in the exe directory (or whatever path you specify) Here's where the problem comes in... Print Screen Key doesn't seem to have a scancode? How would you know when the key was pressed?

I am investigating further...


EDIT POST: Scratch that - Print Screen is scancode 183...
I am sending the dll to exeat now for a wrap


* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 12th Jul 2004 07:10
Very cool. I appreciate this very much. Maybe one day I will be able to help you guys out.

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 12th Jul 2004 07:18
no problem. at least a handful of people are finding our plugin useful

maybe you could post your thoughts on what I mentioned above about joysticks? (is in an edited post above) Just curious on other people's takes


DBP_NETLIB_v1.4.3 - 65 FREE Functions * Click Logo
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 12th Jul 2004 08:08
If I hade multiple joysticks I would love to test it. It sounds like it would work.

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 13th Jul 2004 22:10
@LIT I just emailed you v1.4.4beta



DBP_NETLIB_v1.4.3 - 65 FREE Functions * Click Logo
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 14th Jul 2004 00:37 Edited at: 25th Oct 2004 18:57
Works great. This code ...

gives me this screenshot (sprites and all )
Link Removed
This is the first time I have ever been able to make automatic screenshots from DBP that captures sprites. Thank you!

[edit] Also played around with the wait time ... you can set it lower for high framerates but it needs to be higher at low framerates. 100 worked out to be a pretty good average.

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 14th Jul 2004 00:43
very cool - I am glad you are finding it useful

If you ever need to take screenies that dont overwrite the last one just use something unique in the filename argument...

sTmr as string
stmr="file_" + str$(timer())
clp_SaveImage stmr

or something along those lines
that should save successive images with a new filename each time



DBP_NETLIB_v1.4.3 - 65 FREE Functions * Click Logo
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 14th Jul 2004 01:00
Yes thats what I'm doing. I have another question that you might know the answer to. Will a DBP exe that has some of your commands in it run on a machine that does not have .net frame work installed as long as you don't actually try to use the commands? If so can you make me a function to tell if the minimum .net frame work is installed so I can check it and disable the commands and replace them with DBP's slower commands for these poor souls?

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 14th Jul 2004 01:22
there is a function that returns the .net version BUT .net has to be installed to use it

anyway, you could code in something at the beginning of you program that looks at the registry for the tell-tale signs of .net being istalled. If it finds the key, then you could check the version, let me see if I can find the correct key/s... brb


DBP_NETLIB_v1.4.3 - 65 FREE Functions * Click Logo
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 14th Jul 2004 01:40
ok if this key exists...

HKEY_LOCAL_MACHINE\software\microsoft\.NETFramework\policy\v1.1
with the item inside...
Name: 4322
Type: REG_SZ
Data: 3706-4322

then it is prolly safe to assume that 1.1 is installed. Maybe there is a better key, or a better way to check. I'll look around some more, but for now you could give that a shot from dbp code. I'll post here if I found out more...


DBP_NETLIB_v1.4.3 - 65 FREE Functions * Click Logo
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 14th Jul 2004 03:36
Doh! what was I thinking I'll try to find someone I know who doesn't have .net framework installed and have them try it.

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 14th Jul 2004 04:52
cool.
I was playing with some dbp registry code here but couldn't get it to work. If you get a chance can I see how your dbp code goes to find that/any key ?


DBP_NETLIB_v1.4.3 - 65 FREE Functions * Click Logo
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 14th Jul 2004 05:25
I haven't tried yet. I'm still at work . But when I get it going I'll post it.

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 14th Jul 2004 05:39
okeee


DBP_NETLIB_v1.4.3 - 65 FREE Functions * Click Logo
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 14th Jul 2004 06:47
If I can't do it with DBP commands I may have to learn about making c++ plugins after all and do it with that. I will try DBP first when I get home.

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 14th Jul 2004 10:10
this seems to work ok...



it checks for the existence of \v1.1\4322 key value. If empty string is returned then 1.1 is prolly not installed


DBP_NETLIB_v1.4.3 - 65 FREE Functions * Click Logo
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 14th Jul 2004 11:10 Edited at: 14th Jul 2004 14:21
Cool I was going to cheat and use regedit if those commands didn't work. But that would have been slow.

Rpg Cyco
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Australia
Posted: 15th Jul 2004 20:35 Edited at: 15th Jul 2004 20:36
Hey,

I seem to be confused with the fil_WriteINIkey function, or I've found a bug.

When I run the following code:



I get this error message: Could not understand command at line 6.

The INI file contains:



There was no mention of a return value in the help document, so I have no idea what's wrong. Maybe I'm just using the command wrong.

Thanks for any help!

- Rpg Cyco

Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 15th Jul 2004 22:13
If there is no return value you don't use the (). Try this code


Rpg Cyco
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Australia
Posted: 15th Jul 2004 22:19
Ppfff, I am such an idiot. Thanks.

- Rpg Cyco

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 15th Jul 2004 22:41
glad its sorted.


DBP_NETLIB_v1.4.3 - 65 FREE Functions * Click Logo
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 16th Jul 2004 16:39
Lol, everyone makes that mistake... except me, of course.


"Computers are useless they can only give you answers."
MasterInsan0
21
Years of Service
User Offline
Joined: 14th May 2003
Location: United States
Posted: 17th Jul 2004 06:44 Edited at: 17th Jul 2004 06:48
Hmm, thanks for replying to my e-mail CR (though I just learned about this thread today, heheh). I have the .NET Framework, I just don't like it. And I prolly won't be "upgrading" to Longhorn/Win XP2/whatever.

I have another question though, do you think it would be possible to have the Load File dialog have an option to only return the filename instead of the entire pathname? Or maybe (this would probably be stretching it) have it return the path after the starting path somehow? I use the Load/Save file dialogs for my level editor, and they work great except when I try to load an object with them and then save that filename later. It saves the entire pathname, which is a no-no for my editor (the object files won't always be at CrojectsLEditorobjects).

If you want to see what I'm talking about, get the LeoMap editor on the site in my sig, load an object with it, save the map, and crack the level open in notepad, or hit spacebar (it'll show the whole pathname there too).

Just a plea, heheh. Thanks.

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 17th Jul 2004 07:13
best bet is to use instrrev() function to look at the long path name and find the position of the "\" prior to the actual file name, then use str_Mid to return just the file name back to you...

I'll whip up a code example...


DBP_NETLIB_v1.4.3 - 65 FREE Functions * Click Logo

Login to post a reply

Server time is: 2024-11-24 17:41:53
Your offset time is: 2024-11-24 17:41:53