Author Topic: Lisp experation  (Read 6375 times)

0 Members and 1 Guest are viewing this topic.

PitchBlack98

  • Guest
Lisp experation
« on: April 18, 2006, 08:41:19 PM »
Is there anyway to add some code to a lisp to make it expire after a certain date or time period. I have some lisp routines Im letting a friend borrow, but I want them to expire after a month or 2. I want something that will be fairly easy to setup and possible modify to allow it to run longer. Thanks in advance!

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Lisp experation
« Reply #1 on: April 18, 2006, 08:45:45 PM »
I'm sorry, the answer has expired.

 :lmao:
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

PitchBlack98

  • Guest
Re: Lisp experation
« Reply #2 on: April 18, 2006, 08:51:59 PM »
lol I guess thats better than nothing...  :lol:

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Lisp experation
« Reply #3 on: April 18, 2006, 09:09:28 PM »
``Friend'' huh? ...I usualy ``give'' my friend's stuff.




Okay, im just teasing ya, I'll see if i can help more in the morn.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

PitchBlack98

  • Guest
Re: Lisp experation
« Reply #4 on: April 18, 2006, 09:17:50 PM »
lol Ive been writing simple routines for him for a while. I just want to play with him and see what he thinks when they expire. Oh and if he tries to screw me in the future then he wont be able to use them anymore. lol... They way I see it... I do this for free and if no one wants to give a little back then they dont deserve to make money off the little people that help then out. He helps me out by giving me some drafting on the side when he cant keep up with his work load.

By the way, I got this idea from the Clock lisp that displays the cartoon clock in your CAD. I figured if it can get windows time to set itself there should be a way to add a little code to a lisp to get it to check the date and if its past a certain date then it gives an error or just doesnt work. Maybe display a message that the lisp has expired. That would be great especially if it can just be added to the top of one of my existing routines.
« Last Edit: April 18, 2006, 09:23:43 PM by PitchBlack98 »

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Lisp experation
« Reply #5 on: April 18, 2006, 09:28:22 PM »
There's a number of different things you can do, but --

"friend', "screw me", "won't be able to use them anymore"

??

I've been writing programs for over 2 decades and I've never dealt with my friends this way, let alone acquaintances. This doesn't sum correctly to me, so forgive me if I don't participate.

Gotta love democracy.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

PitchBlack98

  • Guest
Re: Lisp experation
« Reply #6 on: April 18, 2006, 09:41:44 PM »
I was kidding about my friends screwing me. That line was a joke. I show my appreciation by helping people out with just about anything and a little help in return is also appreciated. I basically want to do it for security. I write a lot of routines that Id rather some people I work with either not have at all or just be able to use for a limited time.

One instance I can think of is when I wrote a routine that would make backgrounds for structural drawings out of the clients arch drawings. After it was done and working a coworker told my boss he wrote it and he got a bonus for it since it saved us so much time working with the arch files. I quit working their shortly after and have been doing freelance structural design ever since.

CottageCGirl

  • Guest
Re: Lisp experation
« Reply #7 on: April 18, 2006, 10:17:19 PM »
could you have the lisp read the computer clock when it loads??????

ps: can I assume you are a Riddick fan?

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Lisp experation
« Reply #8 on: April 18, 2006, 10:19:56 PM »
You didn't take that coworker to task with your former boss? Wow.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

PitchBlack98

  • Guest
Re: Lisp experation
« Reply #9 on: April 19, 2006, 12:28:22 AM »
CottageCGirl... No riddick fan here. The movies were OK, but not the best. I actually own a 1998 Mitsubishi eclipse and its solid black from nose to tail. Everything is blacked out on it. Makes it easy to hide at night. lol jk....

As for the coworker, I did say something, but didnt have anyway to prove I had written it. I always put my name and the date written in my codes, but he just changed it. I now encrypt all my codes with protect.exe that I found here. It works very well by the way... but when I called out my coworker and pointed it out to my boss it created a hostile enviroment for me to work in. I was basically look at as a liar and it was getting to the point where it was becoming very verbal in the office. Thats what caused me to leave the company I was working for and persue my own freelance design.

MP... Just dont take what I said about friends screwing me seriously. It was basically a joke. I pick and choose my friends now. and like I said Im the first person to help someone out when they ask, lisp routines or anything else. I actually knew very little about lisp routines before I started to read these forums. I learned a little in college, but not really enough to use it widely. Ive been reading here for the last year and just signed up recently when I needed to ask some questions and help further my self taught knowledge of lisp. Im going to move over to the VB section soon after I get a good handle on lisp. I appreciate you and everyone else on this very informative forum. If it wasnt for the swamp I wouldnt be using lisps today.

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Lisp experation
« Reply #10 on: April 19, 2006, 08:36:51 AM »
Well there are several ways you can do this. Vituraly all can be easly beaten (That's about all your gonna get with AutoLisp.).

Here is a helping hand in the right direction (well the easiest direction.).

Code: [Select]
(defun idate ()
  ;; return the date.
  ;; (idate)
  ;; 20060419 => 04.19.2006
  ;;
  ;; Stolen from somewhere im sure.
  (atoi (rtos (getvar 'cdate) 2 0)))

(if (>= (idate) 20060419)
  (alert "I will not run anymore.")
  )
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

PitchBlack98

  • Guest
Re: Lisp experation
« Reply #11 on: April 19, 2006, 10:08:47 AM »
Thats cool... Ill give it a try and see if I can merge that with my existing code and see what happens. I really appreciate it.

EDIT: I added the code and got it to run before my lisp. When I set the date to make it expired it gives me the popup and after clicking OK the lisp still runs. I tried to make it exit after the popup but no luck yet. Im going to play with it some more and see if I can figure it out unless you know of a solution off the top of your head.

Thanks!
« Last Edit: April 19, 2006, 10:20:48 AM by PitchBlack98 »

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Lisp experation
« Reply #12 on: April 19, 2006, 10:42:39 AM »
That's because what i gave was only a small demonstration into one theory you can use.

(exit)
(quit)
(command) (command)
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Lisp experation
« Reply #13 on: April 19, 2006, 10:44:02 AM »
Try this:

Code: [Select]
(defun idate ()
  ;; return the date.
  ;; (idate)
  ;; 20060419 => 04.19.2006
  ;;
  ;; Stolen from somewhere im sure.
  (atoi (rtos (getvar 'cdate) 2 0))
)
(if (>= (idate) 20060419)
  (progn
   
   ;;Insert your code here
   
  )
  (alert "I will not run anymore.")
)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

PitchBlack98

  • Guest
Re: Lisp experation
« Reply #14 on: April 19, 2006, 10:52:23 AM »
I got it to work using exit a little bit ago. I was looking at it the wrong way and trying to use a cancel command to exit it. All is good now and it works perfectly. Thanks.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Lisp experation
« Reply #15 on: April 20, 2006, 09:28:01 AM »
This may be over the top.
How about writhing to the registry, like this.
When the program starts it looks for a data file and a registry entry.
If not found it ask for the key code with DEMO as a default.
Write the encoded word plus today date and the number of records in a
data file. Assuming your routine adds records to this data file.
Also update a data file with a flag that the countdown has started.
This way if the registry entry has been deleted the data file will alert
the routine of that fact. "Error, Registry damaged" and quit.
If there is a registry record and the data file is missing the routine will not continue.
When the expiration date is reached or the maximum number of new records is
reached the registry is updated with expired flag. Game over.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Lisp experation
« Reply #16 on: April 20, 2006, 11:30:49 AM »
That sounds great, I could use that in some of my programs.  So how would we go about setting that up?
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Lisp experation
« Reply #17 on: April 20, 2006, 11:55:09 AM »
OH, I'm just the idea man. 8-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

whdjr

  • Guest
Re: Lisp experation
« Reply #18 on: April 20, 2006, 03:50:50 PM »
Hey...I thought I was the idea man and you were the one to expand the code... :lmao:

Sounds kinda cool CAB!

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Lisp experation
« Reply #19 on: April 20, 2006, 05:35:00 PM »
 :evil:
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Lisp experation
« Reply #20 on: April 20, 2006, 05:56:02 PM »
The Reg does just fine but a file can be alot easier to use.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

LE

  • Guest
Re: Lisp experation
« Reply #21 on: April 20, 2006, 06:57:06 PM »
I have no idea if still is around the control activelock [activex - VB - free], that can be use in visual lisp applications, to generate trial versions of your software.

HTH.

vinnyg

  • Guest
Re: Lisp experation
« Reply #22 on: May 03, 2006, 08:49:51 AM »
Hey, PitchBlack98

You got it to work?  I'm still confused but only because I'm not
experienced enough to figure it out like you. Could you post this routine
with a small lisp included so I can see for myself how it works in
actual practice and maybe learn how to write and merge different codes
by looking at it.

thanks,

vinnyg

SPDCad

  • Bull Frog
  • Posts: 453
Re: Lisp experation
« Reply #23 on: May 03, 2006, 12:26:43 PM »
I use a straight counter. 30 uses of the programme and then the nag message kicks in. After 50 uses the programme stops running.
I have written the trial code for a client of mine who conveniently forgets to pay me, until the programme stops working.
A date clock trial can be easily hacked by reseting the date on your computer.  ;-)
AutoCAD 2010, w/ OpenDCL

visit: http://reachme.at/spd_designs

Crank

  • Water Moccasin
  • Posts: 1503
Re: Lisp experation
« Reply #24 on: May 06, 2006, 06:18:56 AM »
... unless you create a registry flag and stop working if that flag is present.
Vault Professional 2023     +     AEC Collection

Amsterdammed

  • Guest
Re: Lisp experation
« Reply #25 on: May 06, 2006, 09:14:20 PM »
Chrank,
I set an setenv with the first time the code is loading and every time IT runs till the enddate, I if the computertime is earlier than it already was the code also quits.

Bernd

PitchBlack98

  • Guest
Re: Lisp experation
« Reply #26 on: November 20, 2006, 12:49:26 PM »
I wanted to update this thread...

This bit of code doesnt work in AutoCAD 06 or 07 for me. It seems it can't find the date and errors the entire lisp even if it should still run.