Help - Search - Members - Calendar
Full Version: Fun with Scripts
Dumpshock Forums > Discussion > Shadowrun
Tsithlis
So here are some scripts I've been writing up for my nodes and IC

Script 1 (Node script)
Line1:
Do until global.Active_Alert = 1
Icon_Scantime.getlowerbound(0)
scan.icon
If icon.unauthorized = true then
global.Active_Alert = 1
Exit Do
Else
Icon_Scantime(icon, time)
Loop

If global.Active_Alert = 1 then
Security_Node.logoff
security.notify
Terminate icon.unauthorized
else goto Line1

Script 2 (Attack IC Script)
Line1:
Do until global.Active_Alert = 1
Icon_Scantime.getlowerbound(0)
scan.icon
If icon.unauthorized = true then
global.Active_Alert = 1
Exit Do
Else
Icon_Scantime(icon, time)
Loop

If global.Active_Alert = 1 then
Attack(icon.unauthorized)
else goto Line1

Script 3 (Support IC script)
Line1:
Do until global.Active_Alert = 1
If icon.new then
scan.icon
Else
Icon_Scantime.getlowerbound(0)
scan.icon
If icon.unauthorized = true then
global.Active_Alert = 1
Exit Do
Else
Icon_Scantime(icon, time)
Loop

If global.Active_Alert = 1 then
Do until global.Active_Alert = 0
If Old_Man1.active = false then
Old_Man1.activate
Elseif Old_Man2.active = false then
Old_Man2.activate
Else
Encrypt(access.log)
Loop
else goto Line1
Muspellsheimr
Nice. I like.
Xahn Borealis
What exactly is this?
Fatum
Why bother with writing something looking like real code when even the example in Unwired is in pseudocode anyway, and pseudocode is times easier to read?
Or do you intend to actually use something to run your code and have the hacker have his fun without GM participation? That'd be cool, I guess, especially if you prepare a bunch of templates for the hacker in advance, thus allowing you to skip the usual "wait while the guy is in VR" step.
Tsithlis
QUOTE
What exactly is this?

Its just some object oriented code scripting. Its simplified of course but I was just trying to make the scripts written for nodes and IC look a bit more like scripts. My DM is also a script kiddie so its cool.

Quick breakdown
Script 3 (Support IC script)
Line1:
Do until global.Active_Alert = 1 "check for and active alert and do all of this until there is an active alert"
If icon.new then "If a new icon logs on..."
scan.icon "Scan it"
Else "Otherwise"
Icon_Scantime.getlowerbound(0) "search for the icon that was scanned the longest time ago"
scan.icon "Scan it"
If icon.unauthorized = true then "If the icon is unauthorized"
global.Active_Alert = 1 "Issue an active alert"
Exit Do "Exit this loop and execute the rest of the script below"
Else "Otherwise"
Icon_Scantime(icon, time) "enter the scantime of the icon that was just scanned"
Loop "Do it again"

If global.Active_Alert = 1 then "once there is an active alert"
Do until global.Active_Alert = 0 "do this until there is not an active alert"
If Old_Man1.active = false then "check to see if IC 1 has been crashed"
Old_Man1.activate "if it is crashed then activate it"
Elseif Old_Man2.active = false then "otherwise check to see if IC 2 has been crashed"
Old_Man2.activate "if it has been then activate it"
Else "otherwise"
Encrypt(access.log) "dynamically encrypt the access log"
Loop "do all of this again"
else goto Line1 "once the above script terminates go back to the first script"

QUOTE
Why bother with writing something looking like real code when even the example in Unwired is in pseudocode anyway, and pseudocode is times easier to read?

Because I like a little essence with my shadowrun wink.gif anyway like I said above my DM is a keyboard jockey as well so were good
Xahn Borealis
QUOTE (Fatum @ Mar 7 2010, 10:33 PM) *
the example in Unwired is in pseudocode



What page is this?
Udoshi
QUOTE (Xahn Borealis @ Mar 8 2010, 03:25 PM) *
What page is this?


sidebar, 69.

Something like this would be rather handy to have printed off in notecards at a gametable, really.

Minor annoyance: scan.icon should really be Analyze.Icon. If you keep your fluff names consistent with program names you need to do stuff, it helps prevent rules fuckups.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Dumpshock Forums © 2001-2012